File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -682,6 +682,18 @@ export class Collection<TSchema extends Document = Document> {
682
682
options : FindOptions ,
683
683
callback : Callback < TSchema | undefined >
684
684
) : void ;
685
+
686
+ // allow an override of the schema.
687
+ findOne < T = TSchema > ( ) : Promise < T | undefined > ;
688
+ findOne < T = TSchema > ( callback : Callback < T | undefined > ) : void ;
689
+ findOne < T = TSchema > ( filter : Filter < TSchema > ) : Promise < T | undefined > ;
690
+ findOne < T = TSchema > ( filter : Filter < TSchema > , options ?: FindOptions ) : Promise < T | undefined > ;
691
+ findOne < T = TSchema > (
692
+ filter : Filter < TSchema > ,
693
+ options ?: FindOptions ,
694
+ callback ?: Callback < T | undefined >
695
+ ) : void ;
696
+
685
697
findOne (
686
698
filter ?: Filter < TSchema > | Callback < TSchema | undefined > ,
687
699
options ?: FindOptions | Callback < TSchema | undefined > ,
@@ -717,6 +729,7 @@ export class Collection<TSchema extends Document = Document> {
717
729
*/
718
730
find ( ) : FindCursor < TSchema > ;
719
731
find ( filter : Filter < TSchema > , options ?: FindOptions ) : FindCursor < TSchema > ;
732
+ find < T > ( filter : Filter < TSchema > , options ?: FindOptions ) : FindCursor < T > ;
720
733
find ( filter ?: Filter < TSchema > , options ?: FindOptions ) : FindCursor < TSchema > {
721
734
if ( arguments . length > 2 ) {
722
735
throw new MongoInvalidArgumentError (
You can’t perform that action at this time.
0 commit comments