Updated DbCreateOptions.promoteBuffers to be boolean, updated docs

Existing value was a number and the comment associated was not the
correct information.  Updated to be a boolean and updated comment
to be from https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#.connect
This commit is contained in:
Alex Sherwin
2018-03-19 22:52:49 -04:00
parent 9f4c751261
commit 9e65084d50
2 changed files with 6 additions and 5 deletions

View File

@@ -93,7 +93,7 @@ export interface MongoClientOptions extends
logger?: Object;
// Default: false;
validateOptions?: Object;
// The name of the application that created this MongoClient instance.
// The name of the application that created this MongoClient instance.
appname?: string;
}
@@ -160,8 +160,8 @@ export interface DbCreateOptions extends CommonOptions {
raw?: boolean;
// Default: true; Promotes Long values to number if they fit inside the 53 bits resolution.
promoteLongs?: boolean;
// Default: -1 (unlimited); Amount of operations the driver buffers up untill discard any new ones
promoteBuffers?: number;
// Default: false; Promotes Binary BSON values to native Node Buffers
promoteBuffers?: boolean;
// the prefered read preference. use 'ReadPreference' class.
readPreference?: ReadPreference | string;
// Default: true; Promotes BSON values to native types where possible, set to false to only receive wrapper types.
@@ -1495,7 +1495,7 @@ export interface ChangeStreamOptions {
}
type GridFSBucketWriteStreamId = string | number | Object | ObjectID;
export interface LoggerOptions {
loggerLevel?: string // Custom logger function
logger?: log // Override default global log level.

View File

@@ -25,7 +25,8 @@ let options: mongodb.MongoClientOptions = {
sslCA: ['str'],
sslCert: new Buffer(999),
sslKey: new Buffer(999),
sslPass: new Buffer(999)
sslPass: new Buffer(999),
promoteBuffers: false
}
MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mongodb.MongoError, client: mongodb.MongoClient) {
if (err) throw err;