mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
mongodb: findOne may return null (#20077)
* mongodb: findOne may return null * move union type from MongoCallback to `findOne`
This commit is contained in:
committed by
Ryan Cavanaugh
parent
15d3fb380e
commit
09f8b5494b
Vendored
+3
-3
@@ -506,9 +506,9 @@ export interface Collection<TSchema = Default> {
|
||||
/** @deprecated */
|
||||
find<T = TSchema>(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor<T>;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne
|
||||
findOne<T = TSchema>(filter: Object, callback: MongoCallback<T>): void;
|
||||
findOne<T = TSchema>(filter: Object, options?: FindOneOptions): Promise<T>;
|
||||
findOne<T = TSchema>(filter: Object, options: FindOneOptions, callback: MongoCallback<T>): void;
|
||||
findOne<T = TSchema>(filter: Object, callback: MongoCallback<T | null>): void;
|
||||
findOne<T = TSchema>(filter: Object, options?: FindOneOptions): Promise<T | null>;
|
||||
findOne<T = TSchema>(filter: Object, options: FindOneOptions, callback: MongoCallback<T | null>): void;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete
|
||||
findOneAndDelete(filter: Object, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void;
|
||||
findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject<TSchema>>;
|
||||
|
||||
Reference in New Issue
Block a user