mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Fixed generic type bug in Collection.find (#24857)
This commit is contained in:
committed by
Mohamed Hegazy
parent
4e707e3844
commit
8070848da5
Vendored
+2
-2
@@ -509,9 +509,9 @@ export interface Collection<TSchema = Default> {
|
||||
dropIndexes(callback?: MongoCallback<any>): void;
|
||||
dropIndexes(options: {session?: ClientSession, maxTimeMS?: number}, callback: MongoCallback<any>): void;
|
||||
/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#find */
|
||||
find<T = TSchema>(query?: FilterQuery<T>): Cursor<T>;
|
||||
find<T = TSchema>(query?: FilterQuery<TSchema>): Cursor<T>;
|
||||
/** @deprecated */
|
||||
find<T = TSchema>(query: FilterQuery<T>, options?: FindOneOptions): Cursor<T>;
|
||||
find<T = TSchema>(query: FilterQuery<TSchema>, options?: FindOneOptions): Cursor<T>;
|
||||
/** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOne */
|
||||
findOne<T = TSchema>(filter: FilterQuery<TSchema>, callback: MongoCallback<T | null>): void;
|
||||
findOne<T = TSchema>(filter: FilterQuery<TSchema>, options?: FindOneOptions): Promise<T | null>;
|
||||
|
||||
@@ -113,5 +113,7 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo
|
||||
$and: [{ $gt: 0, $lt: 100 }]
|
||||
}
|
||||
});
|
||||
|
||||
const res: mongodb.Cursor<TestCollection> = testCollection.find({ _id: 123 });
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user