string null optional If the database authentication is dependent on another databaseName.
number | string null optional The write concern.
number null optional The write concern timeout.
boolean false optional Specify a journal write concern.
boolean false optional Force server to assign _id values instead of driver.
boolean false optional Serialize functions on any object.
Boolean false optional Specify if the BSON serializer should ignore undefined fields.
boolean false optional Return document results as raw BSON buffers.
boolean true optional Promotes Long values to number if they fit inside the 53 bits resolution.
boolean false optional Promotes Binary BSON values to native Node Buffers.
boolean true optional Promotes BSON values to native types where possible, set to false to only receive wrapper types.
number -1 optional 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.
ReadPreference | string null optional The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
object null optional A primary key factory object for generation of custom _id keys.
object null optional A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
object null optional Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) Name Type Default Description
object 'local' optional Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
string null optional If the database authentication is dependent on another databaseName.
number -1 optional 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.
boolean false optional Force server to assign _id values instead of driver.
Boolean false optional Specify if the BSON serializer should ignore undefined fields.
boolean false optional Specify a journal write concern.
object 'local' optional Specify a read concern level for the collection operations, one of [local|majority].
object 'local' optional Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
object null optional A primary key factory object for generation of custom _id keys.
object null optional A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
boolean false optional Promotes Binary BSON values to native Node Buffers.
boolean true optional Promotes Long values to number if they fit inside the 53 bits resolution.
boolean true optional Promotes BSON values to native types where possible, set to false to only receive wrapper types.
boolean false optional Return document results as raw BSON buffers.
object null optional Specify a read concern for the collection.
object null optional Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) Name Type Default Description
ReadPreference | string null optional The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
boolean false optional Serialize functions on any object.
number | string null optional The write concern.
number null optional The write concern timeout.
Database Options