From 9e65084d50afd0d102407a8f96a5d6656dd59f9e Mon Sep 17 00:00:00 2001 From: Alex Sherwin Date: Mon, 19 Mar 2018 22:52:49 -0400 Subject: [PATCH] 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 --- types/mongodb/index.d.ts | 8 ++++---- types/mongodb/mongodb-tests.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index ba27943739..389f1390a3 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -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. diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index 852522aadc..af307ce6d8 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -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;