From b0d31d86b194178eb882ca60fc37d53b16c7e12e Mon Sep 17 00:00:00 2001 From: beary Date: Thu, 4 May 2017 19:19:41 +0800 Subject: [PATCH] Add generic to findOneAnd*** functions --- types/mongodb/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index bd15f3bd07..02208e721b 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -461,25 +461,25 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query?: Object): Cursor; + find(query?: Object): Cursor; /** @deprecated */ find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - findOne(filter: Object, callback: MongoCallback): void; + findOne(filter: Object, callback: MongoCallback): void; findOne(filter: Object, options?: FindOneOptions): Promise; findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete - findOneAndDelete(filter: Object, callback: MongoCallback): void; - findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; - findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback): void; + findOneAndDelete(filter: Object, callback: MongoCallback>): void; + findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise>; + findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndReplace - findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback): void; - findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback>): void; + findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndUpdate - findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback): void; - findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback>): void; + findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#geoHaystackSearch geoHaystackSearch(x: number, y: number, callback: MongoCallback): void; geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise; @@ -707,9 +707,9 @@ export interface DeleteWriteOpResultObject { } //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~findAndModifyWriteOpResult -export interface FindAndModifyWriteOpResultObject { +export interface FindAndModifyWriteOpResultObject { //Document returned from findAndModify command. - value?: any; + value?: TSchema; //The raw lastErrorObject returned from the command. lastErrorObject?: any; //Is 1 if the command executed correctly.