Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). Default: 15
Sets the authentication mechanism that MongoDB will use to authenticate the connection
If the database authentication is dependent on another databaseName.
Reconnect on error. Default: true
Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited.
Allows to setup cache options.
CLI settings.
TCP Connection timeout setting. Default: 30000
Sets if the driver should connect even if no primary is available. Default: false
Database name to connect to.
Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false
Drops the schema each time connection is being established. Be careful with this option and don't use this in production - otherwise you'll lose all production data. This option is useful during debug and development.
Entities to be loaded for this connection. Accepts both entity classes and directories where from entities need to be loaded. Directories support glob patterns.
Prefix to use on all tables (collections) of this connection in the database.
Extra connection options to be passed to the underlying driver.
todo: deprecate this and move all database-specific types into hts own connection options object.
Force server to assign _id values instead of driver. Default: false
Turn on high availability monitoring. Default true
Time between each replicaset status check. Default: 10000,5000
Database host.
Specify if the BSON serializer should ignore undefined fields. Default: false
Specify a journal write concern. Default: false
The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000
Logger instance used to log queries and events in the ORM.
Specify the log level used by the driver logger (error/warn/info/debug).
Logging options.
Maximum number of milliseconds query should be executed before logger log a warning.
Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds
Migrations to be loaded for this connection. Accepts both migration classes and directories where from migrations need to be loaded. Directories support glob patterns.
Indicates if migrations should be auto run on every application launch. Alternative to it, you can use CLI and run migrations:run command.
Migrations table name, in case of different name from "migrations". Accepts single string name.
Connection name. If connection name is not given then it will be called "default". Different connections must have different names.
Naming strategy to be used to name tables and columns in the database.
TCP Socket NoDelay option. Default: true
Database password.
A primary key factory object for generation of custom _id keys.
Set the maximum poolSize for each individual server or proxy connection.
Database host port.
A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible.
Promotes Binary BSON values to native Node Buffers. Default: false
Promotes Long values to number if they fit inside the 53 bits resolution. Default: true
Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true
Return document results as raw BSON buffers. Default: false
Specify a read concern for the collection. (only MongoDB 3.2 or higher supported).
The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
Server will wait #milliseconds between retries. Default 1000
Server attempt to reconnect #times. Default 30
The name of the replicaset to connect to
Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). Default: 15
Serialize functions on any object. Default: false
TCP Socket timeout setting. Default: 360000
Use ssl connection (needs to have a mongod server with ssl support). Default: false
Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher).
String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher). Default: true
Subscribers to be loaded for this connection. Accepts both subscriber classes and directories where from subscribers need to be loaded. Directories support glob patterns.
Indicates if database schema should be auto created on every application launch. Be careful with this option and don't use this in production - otherwise you can lose production data. This option is useful during debug and development. Alternative to it, you can use CLI and run schema:sync command.
Note that for MongoDB database it does not create schema, because MongoDB is schemaless. Instead, it syncs just by creating indices.
Database type.
Connection url where perform connection to.
Database username.
The write concern.
The write concern timeout value.
Generated using TypeDoc
MongoDB specific connection options.