@@ -271,7 +271,7 @@ declare module 'mongoose' {
271
271
distinct < ReturnType = any > ( field : string , filter ?: FilterQuery < DocType > , callback ?: Callback < number > ) : QueryWithHelpers < Array < ReturnType > , DocType , THelpers , RawDocType > ;
272
272
273
273
/** Specifies a `$elemMatch` query condition. When called with one argument, the most recent path passed to `where()` is used. */
274
- elemMatch < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$elemMatch' ] ) : this;
274
+ elemMatch < K = string > ( path : K , val : any ) : this;
275
275
elemMatch ( val : Function | any ) : this;
276
276
277
277
/**
@@ -288,7 +288,7 @@ declare module 'mongoose' {
288
288
estimatedDocumentCount ( options ?: QueryOptions < DocType > , callback ?: Callback < number > ) : QueryWithHelpers < number , DocType , THelpers , RawDocType > ;
289
289
290
290
/** Specifies a `$exists` query condition. When called with one argument, the most recent path passed to `where()` is used. */
291
- exists < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$exists' ] ) : this;
291
+ exists < K = string > ( path : K , val : boolean ) : this;
292
292
exists ( val : boolean ) : this;
293
293
294
294
/**
@@ -403,18 +403,18 @@ declare module 'mongoose' {
403
403
getUpdate ( ) : UpdateQuery < DocType > | UpdateWithAggregationPipeline | null ;
404
404
405
405
/** Specifies a `$gt` query condition. When called with one argument, the most recent path passed to `where()` is used. */
406
- gt < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$gt' ] ) : this;
406
+ gt < K = string > ( path : K , val : any ) : this;
407
407
gt ( val : number ) : this;
408
408
409
409
/** Specifies a `$gte` query condition. When called with one argument, the most recent path passed to `where()` is used. */
410
- gte < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$gte' ] ) : this;
410
+ gte < K = string > ( path : K , val : any ) : this;
411
411
gte ( val : number ) : this;
412
412
413
413
/** Sets query hints. */
414
414
hint ( val : any ) : this;
415
415
416
416
/** Specifies an `$in` query condition. When called with one argument, the most recent path passed to `where()` is used. */
417
- in < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$in' ] ) : this;
417
+ in < K = string > ( path : K , val : any [ ] ) : this;
418
418
in ( val : Array < any > ) : this;
419
419
420
420
/** Declares an intersects query for `geometry()`. */
@@ -430,11 +430,11 @@ declare module 'mongoose' {
430
430
limit ( val : number ) : this;
431
431
432
432
/** Specifies a `$lt` query condition. When called with one argument, the most recent path passed to `where()` is used. */
433
- lt < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$lt' ] ) : this;
433
+ lt < K = string > ( path : K , val : any ) : this;
434
434
lt ( val : number ) : this;
435
435
436
436
/** Specifies a `$lte` query condition. When called with one argument, the most recent path passed to `where()` is used. */
437
- lte < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$lte' ] ) : this;
437
+ lte < K = string > ( path : K , val : any ) : this;
438
438
lte ( val : number ) : this;
439
439
440
440
/**
@@ -461,7 +461,7 @@ declare module 'mongoose' {
461
461
merge ( source : Query < any , any > | FilterQuery < DocType > ) : this;
462
462
463
463
/** Specifies a `$mod` condition, filters documents for documents whose `path` property is a number that is equal to `remainder` modulo `divisor`. */
464
- mod < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$mod' ] ) : this;
464
+ mod < K = string > ( path : K , val : number ) : this;
465
465
mod ( val : Array < number > ) : this;
466
466
467
467
/** The model this query was created from */
@@ -474,15 +474,15 @@ declare module 'mongoose' {
474
474
mongooseOptions ( val ?: MongooseQueryOptions ) : MongooseQueryOptions ;
475
475
476
476
/** Specifies a `$ne` query condition. When called with one argument, the most recent path passed to `where()` is used. */
477
- ne < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$ne' ] ) : this;
477
+ ne < K = string > ( path : K , val : any ) : this;
478
478
ne ( val : any ) : this;
479
479
480
480
/** Specifies a `$near` or `$nearSphere` condition */
481
- near < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$near' ] ) : this;
481
+ near < K = string > ( path : K , val : any ) : this;
482
482
near ( val : any ) : this;
483
483
484
484
/** Specifies an `$nin` query condition. When called with one argument, the most recent path passed to `where()` is used. */
485
- nin < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$nin' ] ) : this;
485
+ nin < K = string > ( path : K , val : any [ ] ) : this;
486
486
nin ( val : Array < any > ) : this;
487
487
488
488
/** Specifies arguments for an `$nor` condition. */
@@ -518,7 +518,7 @@ declare module 'mongoose' {
518
518
readConcern ( level : string ) : this;
519
519
520
520
/** Specifies a `$regex` query condition. When called with one argument, the most recent path passed to `where()` is used. */
521
- regex < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$regex' ] ) : this;
521
+ regex < K = string > ( path : K , val : RegExp ) : this;
522
522
regex ( val : string | RegExp ) : this;
523
523
524
524
/**
@@ -570,7 +570,7 @@ declare module 'mongoose' {
570
570
setUpdate ( update : UpdateQuery < DocType > | UpdateWithAggregationPipeline ) : void ;
571
571
572
572
/** Specifies an `$size` query condition. When called with one argument, the most recent path passed to `where()` is used. */
573
- size < K extends keyof FilterQuery < DocType > > ( path : K , val : FilterQuery < DocType > [ K ] [ '$size' ] ) : this;
573
+ size < K = string > ( path : K , val : number ) : this;
574
574
size ( val : number ) : this;
575
575
576
576
/** Specifies the number of documents to skip. */
@@ -599,7 +599,7 @@ declare module 'mongoose' {
599
599
then : Promise < ResultType > [ 'then' ] ;
600
600
601
601
/** Converts this query to a customized, reusable query constructor with all arguments and options retained. */
602
- toConstructor ( ) : new ( ... args : any [ ] ) => QueryWithHelpers < ResultType , DocType , THelpers , RawDocType > ;
602
+ toConstructor ( ) : typeof this ;
603
603
604
604
/** Declare and/or execute this query as an update() operation. */
605
605
update ( filter ?: FilterQuery < DocType > , update ?: UpdateQuery < DocType > | UpdateWithAggregationPipeline , options ?: QueryOptions < DocType > | null , callback ?: Callback < UpdateWriteOpResult > ) : QueryWithHelpers < UpdateWriteOpResult , DocType , THelpers , RawDocType > ;
0 commit comments