From 09f8b5494b397bc834d221a96f095d86e4be27e9 Mon Sep 17 00:00:00 2001 From: Danny Martini Date: Mon, 2 Oct 2017 19:31:00 +0200 Subject: [PATCH] mongodb: findOne may return null (#20077) * mongodb: findOne may return null * move union type from MongoCallback to `findOne` --- types/mongodb/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 04e38d90f6..b53fd829ba 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -506,9 +506,9 @@ export interface Collection { /** @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, options?: FindOneOptions): Promise; - findOne(filter: Object, options: FindOneOptions, 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>;