![]() ![]() «Number» Passed transparently to Node.js' dns.lookup() function.This option is passed to Node.js socket#setTimeout() function after the MongoDB driver successfully completes. This is set to 30000 by default, you should set this to 2-3x your longest running operation if you expect some of your database operations to run longer than 20 seconds. A socket may be inactive because of either no activity or a long-running operation. «Number» How long the MongoDB driver will wait before killing a socket due to inactivity after initial connection.This option is passed transparently to Node.js' socket#setTimeout() function. «Number» How long the MongoDB driver will wait before killing a socket due to inactivity during initial connection.«Class» Sets the underlying driver's promise library.Set to false to disable automatic index creation for all models associated with this connection. We recommend you do not set this setting below 1000, too many heartbeats can lead to performance degradation. Mongoose only emits a 'disconnected' event after a heartbeat has failed, so you may want to decrease this setting to reduce the time between when your server goes down and when Mongoose emits 'disconnected'. ![]() A heartbeat is subject to serverSelectionTimeoutMS, so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. «Number» If useUnifiedTopology = true, the MongoDB driver sends a heartbeat every heartbeatFrequencyMS to check on the status of the connection. ![]() If not set, the MongoDB driver defaults to using 30000 (30 seconds). «Number» If useUnifiedTopology = true, the MongoDB driver will try to find a server to send any given operation to, and keep retrying for serverSelectionTimeoutMS milliseconds before erroring out.«Number» The minimum number of sockets the MongoDB driver will keep open for this connection.Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. «Number» The maximum number of sockets the MongoDB driver will keep open for this connection.«String» password for authentication, equivalent to.«String» username for authentication, equivalent to.If not provided, use database name from connection string. «String» The name of the database we want to use.If bufferCommands is true, Mongoose will throw an error after bufferTimeoutMS if the operation is still buffered. Set to false to disable buffering on all models associated with this connection. ![]()
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |