File tree 2 files changed +39
-7
lines changed
2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -544,3 +544,29 @@ function gh14190() {
544
544
ModifyResult < ReturnType < ( typeof UserModel ) [ 'hydrate' ] > >
545
545
> ( res2 ) ;
546
546
}
547
+
548
+ function mongooseQueryOptions ( ) {
549
+ const userSchema = new Schema ( { name : String , age : Number } ) ;
550
+ const UserModel = model ( 'User' , userSchema ) ;
551
+
552
+ UserModel . updateOne (
553
+ { name : 'bar' } ,
554
+ { name : 'baz' } ,
555
+ {
556
+ multipleCastError : true ,
557
+ overwriteDiscriminatorKey : true ,
558
+ runValidators : true ,
559
+ sanitizeProjection : true ,
560
+ sanitizeFilter : true ,
561
+ strict : true ,
562
+ strictQuery : 'throw' ,
563
+ timestamps : false ,
564
+ translateAliases : false
565
+ }
566
+ ) ;
567
+
568
+ UserModel . findOne ( { } , null , {
569
+ lean : true ,
570
+ populate : 'test'
571
+ } ) ;
572
+ }
Original file line number Diff line number Diff line change @@ -17,13 +17,19 @@ declare module 'mongoose' {
17
17
*/
18
18
type FilterQuery < T > = _FilterQuery < T > ;
19
19
20
- type MongooseQueryOptions < DocType = unknown > = Pick < QueryOptions < DocType > , 'populate' |
21
- 'lean' |
22
- 'strict' |
23
- 'sanitizeProjection' |
24
- 'sanitizeFilter' |
25
- 'timestamps' |
26
- 'translateAliases'
20
+ type MongooseQueryOptions < DocType = unknown > = Pick <
21
+ QueryOptions < DocType > ,
22
+ 'lean' |
23
+ 'multipleCastError' |
24
+ 'overwriteDiscriminatorKey' |
25
+ 'populate' |
26
+ 'runValidators' |
27
+ 'sanitizeProjection' |
28
+ 'sanitizeFilter' |
29
+ 'strict' |
30
+ 'strictQuery' |
31
+ 'timestamps' |
32
+ 'translateAliases'
27
33
> ;
28
34
29
35
type ProjectionFields < DocType > = { [ Key in keyof DocType ] ?: any } & Record < string , any > ;
You can’t perform that action at this time.
0 commit comments