From 0de529dbcd9e8daf7e523ffc4c3aceb58a4cbe5e Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Fri, 22 Feb 2019 12:12:35 +0100 Subject: [PATCH 1/3] fix(mongodb): add collation option to findOneAndReplace and FindOneAndDelete --- types/mongodb/index.d.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index a3725382e4..dac421a22a 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -879,8 +879,8 @@ export interface Collection { findOne(filter: FilterQuery, options: FindOneOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ findOneAndDelete(filter: FilterQuery, callback: MongoCallback>): void; - findOneAndDelete(filter: FilterQuery, options?: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }): Promise>; - findOneAndDelete(filter: FilterQuery, options: { projection?: Object, sort?: Object, maxTimeMS?: number, session?: ClientSession }, callback: MongoCallback>): void; + findOneAndDelete(filter: FilterQuery, options?: FindOneAndDeleteOption): Promise>; + findOneAndDelete(filter: FilterQuery, options: FindOneAndDeleteOption, callback: MongoCallback>): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndReplace */ findOneAndReplace(filter: FilterQuery, replacement: Object, callback: MongoCallback>): void; findOneAndReplace(filter: FilterQuery, replacement: Object, options?: FindOneAndReplaceOption): Promise>; @@ -1292,7 +1292,7 @@ export interface CollectionAggregationOptions { * Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ bypassDocumentValidation?: boolean; - hint?: string | object; + hint?: string | object; raw?: boolean; promoteLongs?: boolean; promoteValues?: boolean; @@ -1407,6 +1407,7 @@ export interface FindOneAndReplaceOption extends CommonOptions { maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean; + collation?: CollationDocument; } /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndUpdate */ @@ -1414,6 +1415,17 @@ export interface FindOneAndUpdateOption extends FindOneAndReplaceOption { arrayFilters?: Object[]; } +/** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ +export interface FindOneAndDeleteOption { + projection?: Object; + sort?: Object; + maxTimeMS?: number; + session?: ClientSession; + collation?: CollationDocument; +} + + + /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ export interface GeoHaystackSearchOptions { readPreference?: ReadPreference | string; From d055d9a889640fdc839a0b703632bd49ac41067a Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Mon, 25 Feb 2019 09:38:10 +0100 Subject: [PATCH 2/3] fix(mongo): change Object in object --- types/mongodb/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index dac421a22a..9fb58dbfc4 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1424,8 +1424,6 @@ export interface FindOneAndDeleteOption { collation?: CollationDocument; } - - /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#geoHaystackSearch */ export interface GeoHaystackSearchOptions { readPreference?: ReadPreference | string; From 3bd113c6b8af103d53112faa320543b290ec4102 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Mon, 25 Feb 2019 09:41:54 +0100 Subject: [PATCH 3/3] fix(mongodb): change Object in object --- types/mongodb/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 9fb58dbfc4..51393a8d25 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1417,8 +1417,8 @@ export interface FindOneAndUpdateOption extends FindOneAndReplaceOption { /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#findOneAndDelete */ export interface FindOneAndDeleteOption { - projection?: Object; - sort?: Object; + projection?: object; + sort?: object; maxTimeMS?: number; session?: ClientSession; collation?: CollationDocument;