@@ -217,7 +217,7 @@ declare module 'mongoose' {
217
217
allowDiskUse ( value : boolean ) : this;
218
218
219
219
/** Specifies arguments for an `$and` condition. */
220
- and ( array : FilterQuery < DocType > [ ] ) : this;
220
+ and ( array : FilterQuery < RawDocType > [ ] ) : this;
221
221
222
222
/** Specifies the batchSize option. */
223
223
batchSize ( val : number ) : this;
@@ -265,7 +265,7 @@ declare module 'mongoose' {
265
265
comment ( val : string ) : this;
266
266
267
267
/** Specifies this query as a `count` query. */
268
- count ( criteria ?: FilterQuery < DocType > ) : QueryWithHelpers <
268
+ count ( criteria ?: FilterQuery < RawDocType > ) : QueryWithHelpers <
269
269
number ,
270
270
DocType ,
271
271
THelpers ,
@@ -275,7 +275,7 @@ declare module 'mongoose' {
275
275
276
276
/** Specifies this query as a `countDocuments` query. */
277
277
countDocuments (
278
- criteria ?: FilterQuery < DocType > ,
278
+ criteria ?: FilterQuery < RawDocType > ,
279
279
options ?: QueryOptions < DocType >
280
280
) : QueryWithHelpers < number , DocType , THelpers , RawDocType , 'countDocuments' > ;
281
281
@@ -291,10 +291,10 @@ declare module 'mongoose' {
291
291
* collection, regardless of the value of `single`.
292
292
*/
293
293
deleteMany (
294
- filter ?: FilterQuery < DocType > ,
294
+ filter ?: FilterQuery < RawDocType > ,
295
295
options ?: QueryOptions < DocType >
296
296
) : QueryWithHelpers < any , DocType , THelpers , RawDocType , 'deleteMany' > ;
297
- deleteMany ( filter : FilterQuery < DocType > ) : QueryWithHelpers <
297
+ deleteMany ( filter : FilterQuery < RawDocType > ) : QueryWithHelpers <
298
298
any ,
299
299
DocType ,
300
300
THelpers ,
@@ -309,10 +309,10 @@ declare module 'mongoose' {
309
309
* option.
310
310
*/
311
311
deleteOne (
312
- filter ?: FilterQuery < DocType > ,
312
+ filter ?: FilterQuery < RawDocType > ,
313
313
options ?: QueryOptions < DocType >
314
314
) : QueryWithHelpers < any , DocType , THelpers , RawDocType , 'deleteOne' > ;
315
- deleteOne ( filter : FilterQuery < DocType > ) : QueryWithHelpers <
315
+ deleteOne ( filter : FilterQuery < RawDocType > ) : QueryWithHelpers <
316
316
any ,
317
317
DocType ,
318
318
THelpers ,
@@ -324,7 +324,7 @@ declare module 'mongoose' {
324
324
/** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */
325
325
distinct < ReturnType = any > (
326
326
field : string ,
327
- filter ?: FilterQuery < DocType >
327
+ filter ?: FilterQuery < RawDocType >
328
328
) : QueryWithHelpers < Array < ReturnType > , DocType , THelpers , RawDocType , 'distinct' > ;
329
329
330
330
/** Specifies a `$elemMatch` query condition. When called with one argument, the most recent path passed to `where()` is used. */
@@ -364,71 +364,71 @@ declare module 'mongoose' {
364
364
365
365
/** Creates a `find` query: gets a list of documents that match `filter`. */
366
366
find (
367
- filter : FilterQuery < DocType > ,
368
- projection ?: ProjectionType < DocType > | null ,
367
+ filter : FilterQuery < RawDocType > ,
368
+ projection ?: ProjectionType < RawDocType > | null ,
369
369
options ?: QueryOptions < DocType > | null
370
370
) : QueryWithHelpers < Array < DocType > , DocType , THelpers , RawDocType , 'find' > ;
371
371
find (
372
- filter : FilterQuery < DocType > ,
373
- projection ?: ProjectionType < DocType > | null
372
+ filter : FilterQuery < RawDocType > ,
373
+ projection ?: ProjectionType < RawDocType > | null
374
374
) : QueryWithHelpers < Array < DocType > , DocType , THelpers , RawDocType , 'find' > ;
375
375
find (
376
- filter : FilterQuery < DocType >
377
- ) : QueryWithHelpers < Array < DocType > , DocType , THelpers , RawDocType , 'find' > ;
376
+ filter : FilterQuery < RawDocType >
377
+ ) : QueryWithHelpers < Array < RawDocType > , DocType , THelpers , RawDocType , 'find' > ;
378
378
find ( ) : QueryWithHelpers < Array < DocType > , DocType , THelpers , RawDocType , 'find' > ;
379
379
380
380
/** Declares the query a findOne operation. When executed, returns the first found document. */
381
381
findOne (
382
- filter ?: FilterQuery < DocType > ,
383
- projection ?: ProjectionType < DocType > | null ,
382
+ filter ?: FilterQuery < RawDocType > ,
383
+ projection ?: ProjectionType < RawDocType > | null ,
384
384
options ?: QueryOptions < DocType > | null
385
385
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOne' > ;
386
386
findOne (
387
- filter ?: FilterQuery < DocType > ,
388
- projection ?: ProjectionType < DocType > | null
387
+ filter ?: FilterQuery < RawDocType > ,
388
+ projection ?: ProjectionType < RawDocType > | null
389
389
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOne' > ;
390
390
findOne (
391
- filter ?: FilterQuery < DocType >
392
- ) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOne' > ;
391
+ filter ?: FilterQuery < RawDocType >
392
+ ) : QueryWithHelpers < DocType | null , RawDocType , THelpers , RawDocType , 'findOne' > ;
393
393
394
394
/** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */
395
395
findOneAndDelete (
396
- filter ?: FilterQuery < DocType > ,
396
+ filter ?: FilterQuery < RawDocType > ,
397
397
options ?: QueryOptions < DocType > | null
398
398
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOneAndDelete' > ;
399
399
400
400
/** Creates a `findOneAndRemove` query: atomically finds the given document and deletes it. */
401
401
findOneAndRemove (
402
- filter ?: FilterQuery < DocType > ,
402
+ filter ?: FilterQuery < RawDocType > ,
403
403
options ?: QueryOptions < DocType > | null
404
404
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOneAndRemove' > ;
405
405
406
406
/** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */
407
407
findOneAndUpdate (
408
- filter : FilterQuery < DocType > ,
409
- update : UpdateQuery < DocType > ,
408
+ filter : FilterQuery < RawDocType > ,
409
+ update : UpdateQuery < RawDocType > ,
410
410
options : QueryOptions < DocType > & { rawResult : true }
411
411
) : QueryWithHelpers < ModifyResult < DocType > , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
412
412
findOneAndUpdate (
413
- filter : FilterQuery < DocType > ,
414
- update : UpdateQuery < DocType > ,
413
+ filter : FilterQuery < RawDocType > ,
414
+ update : UpdateQuery < RawDocType > ,
415
415
options : QueryOptions < DocType > & { upsert : true } & ReturnsNewDoc
416
416
) : QueryWithHelpers < DocType , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
417
417
findOneAndUpdate (
418
- filter ?: FilterQuery < DocType > ,
419
- update ?: UpdateQuery < DocType > ,
418
+ filter ?: FilterQuery < RawDocType > ,
419
+ update ?: UpdateQuery < RawDocType > ,
420
420
options ?: QueryOptions < DocType > | null
421
421
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
422
422
423
423
/** Declares the query a findById operation. When executed, returns the document with the given `_id`. */
424
424
findById (
425
425
id : mongodb . ObjectId | any ,
426
- projection ?: ProjectionType < DocType > | null ,
426
+ projection ?: ProjectionType < RawDocType > | null ,
427
427
options ?: QueryOptions < DocType > | null
428
428
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOne' > ;
429
429
findById (
430
430
id : mongodb . ObjectId | any ,
431
- projection ?: ProjectionType < DocType > | null
431
+ projection ?: ProjectionType < RawDocType > | null
432
432
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOne' > ;
433
433
findById (
434
434
id : mongodb . ObjectId | any
@@ -443,22 +443,22 @@ declare module 'mongoose' {
443
443
/** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */
444
444
findByIdAndUpdate (
445
445
id : mongodb . ObjectId | any ,
446
- update : UpdateQuery < DocType > ,
446
+ update : UpdateQuery < RawDocType > ,
447
447
options : QueryOptions < DocType > & { rawResult : true }
448
448
) : QueryWithHelpers < any , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
449
449
findByIdAndUpdate (
450
450
id : mongodb . ObjectId | any ,
451
- update : UpdateQuery < DocType > ,
451
+ update : UpdateQuery < RawDocType > ,
452
452
options : QueryOptions < DocType > & { upsert : true } & ReturnsNewDoc
453
453
) : QueryWithHelpers < DocType , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
454
454
findByIdAndUpdate (
455
455
id ?: mongodb . ObjectId | any ,
456
- update ?: UpdateQuery < DocType > ,
456
+ update ?: UpdateQuery < RawDocType > ,
457
457
options ?: QueryOptions < DocType > | null
458
458
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
459
459
findByIdAndUpdate (
460
460
id : mongodb . ObjectId | any ,
461
- update : UpdateQuery < DocType >
461
+ update : UpdateQuery < RawDocType >
462
462
) : QueryWithHelpers < DocType | null , DocType , THelpers , RawDocType , 'findOneAndUpdate' > ;
463
463
464
464
/** Specifies a `$geometry` condition */
@@ -472,7 +472,7 @@ declare module 'mongoose' {
472
472
get ( path : string ) : any ;
473
473
474
474
/** Returns the current query filter (also known as conditions) as a POJO. */
475
- getFilter ( ) : FilterQuery < DocType > ;
475
+ getFilter ( ) : FilterQuery < RawDocType > ;
476
476
477
477
/** Gets query options. */
478
478
getOptions ( ) : QueryOptions < DocType > ;
@@ -481,7 +481,7 @@ declare module 'mongoose' {
481
481
getPopulatedPaths ( ) : Array < string > ;
482
482
483
483
/** Returns the current query filter. Equivalent to `getFilter()`. */
484
- getQuery ( ) : FilterQuery < DocType > ;
484
+ getQuery ( ) : FilterQuery < RawDocType > ;
485
485
486
486
/** Returns the current update operations as a JSON object. */
487
487
getUpdate ( ) : UpdateQuery < DocType > | UpdateWithAggregationPipeline | null ;
@@ -551,7 +551,7 @@ declare module 'mongoose' {
551
551
maxTimeMS ( ms : number ) : this;
552
552
553
553
/** Merges another Query or conditions object into this one. */
554
- merge ( source : Query < any , any > | FilterQuery < DocType > ) : this;
554
+ merge ( source : Query < any , any > | FilterQuery < RawDocType > ) : this;
555
555
556
556
/** Specifies a `$mod` condition, filters documents for documents whose `path` property is a number that is equal to `remainder` modulo `divisor`. */
557
557
mod < K = string > ( path : K , val : number ) : this;
@@ -579,10 +579,10 @@ declare module 'mongoose' {
579
579
nin ( val : Array < any > ) : this;
580
580
581
581
/** Specifies arguments for an `$nor` condition. */
582
- nor ( array : Array < FilterQuery < DocType > > ) : this;
582
+ nor ( array : Array < FilterQuery < RawDocType > > ) : this;
583
583
584
584
/** Specifies arguments for an `$or` condition. */
585
- or ( array : Array < FilterQuery < DocType > > ) : this;
585
+ or ( array : Array < FilterQuery < RawDocType > > ) : this;
586
586
587
587
/**
588
588
* Make this query throw an error if no documents match the given `filter`.
@@ -639,7 +639,7 @@ declare module 'mongoose' {
639
639
* not accept any [atomic](https://www.mongodb.com/docs/manual/tutorial/model-data-for-atomic-operations/#pattern) operators (`$set`, etc.)
640
640
*/
641
641
replaceOne (
642
- filter ?: FilterQuery < DocType > ,
642
+ filter ?: FilterQuery < RawDocType > ,
643
643
replacement ?: DocType | AnyObject ,
644
644
options ?: QueryOptions < DocType > | null
645
645
) : QueryWithHelpers < any , DocType , THelpers , RawDocType , 'replaceOne' > ;
@@ -698,9 +698,9 @@ declare module 'mongoose' {
698
698
setOptions ( options : QueryOptions < DocType > , overwrite ?: boolean ) : this;
699
699
700
700
/** Sets the query conditions to the provided JSON object. */
701
- setQuery ( val : FilterQuery < DocType > | null ) : void ;
701
+ setQuery ( val : FilterQuery < RawDocType > | null ) : void ;
702
702
703
- setUpdate ( update : UpdateQuery < DocType > | UpdateWithAggregationPipeline ) : void ;
703
+ setUpdate ( update : UpdateQuery < RawDocType > | UpdateWithAggregationPipeline ) : void ;
704
704
705
705
/** Specifies an `$size` query condition. When called with one argument, the most recent path passed to `where()` is used. */
706
706
size < K = string > ( path : K , val : number ) : this;
@@ -738,8 +738,8 @@ declare module 'mongoose' {
738
738
* the `multi` option.
739
739
*/
740
740
updateMany (
741
- filter ?: FilterQuery < DocType > ,
742
- update ?: UpdateQuery < DocType > | UpdateWithAggregationPipeline ,
741
+ filter ?: FilterQuery < RawDocType > ,
742
+ update ?: UpdateQuery < RawDocType > | UpdateWithAggregationPipeline ,
743
743
options ?: QueryOptions < DocType > | null
744
744
) : QueryWithHelpers < UpdateWriteOpResult , DocType , THelpers , RawDocType , 'updateMany' > ;
745
745
@@ -748,8 +748,8 @@ declare module 'mongoose' {
748
748
* `update()`, except it does not support the `multi` or `overwrite` options.
749
749
*/
750
750
updateOne (
751
- filter ?: FilterQuery < DocType > ,
752
- update ?: UpdateQuery < DocType > | UpdateWithAggregationPipeline ,
751
+ filter ?: FilterQuery < RawDocType > ,
752
+ update ?: UpdateQuery < RawDocType > | UpdateWithAggregationPipeline ,
753
753
options ?: QueryOptions < DocType > | null
754
754
) : QueryWithHelpers < UpdateWriteOpResult , DocType , THelpers , RawDocType , 'updateOne' > ;
755
755
0 commit comments