Inside the backend/WeivData/connection-options.js file you can define three different factory function and export them. These factory functions can be used to customize each role's MongoClient connection options like connection pool settings etc.

export const adminClientOptions = () => {
// ... custom admin options here
return;
}

export const memberClientOptions = () => {
// ... custom member options here
return;
}

export const visitorClientOptions = () => {
// ... custom visitor options here
return;
}

You can also define custom cache options for all clients. These cache options define how to cache these clients. In most cases you don't need to play with this.

export const clientCacheRules = () => {
// ... custom client cache rules
return;
}

You can create async functions too (in case you need to fetch something before setting up things).

interface ConnectionOptions {
    adminClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>);
    clientCacheRules: (() => Options | Promise<Options>);
    memberClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>);
    visitorClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>);
}

Properties

adminClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>)

This is the same MongoClientOptions just like in MongoDB NodeJS driver, you can customize the admin MongoClient options.

Read more about MongoClientOptions

clientCacheRules: (() => Options | Promise<Options>)

This is general cache rules for all MongoClients you can define node-cache options here. These options will apply to all roles clients.

Read more about NodeCache.Options

memberClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>)

This is the same MongoClientOptions just like in MongoDB NodeJS driver, you can customize the member MongoClient options.

Read more about MongoClientOptions

visitorClientOptions: (() => MongoClientOptions | Promise<MongoClientOptions>)

This is the same MongoClientOptions just like in MongoDB NodeJS driver, you can customize the visitor MongoClient options.

Read more about MongoClientOptions