1 | declare module 'mongoose' {
|
2 | import mongodb = require('mongodb');
|
3 |
|
4 | export type ApplyBasicQueryCasting<T> = T | T[] | (T extends (infer U)[] ? U : any) | any;
|
5 | type Condition<T> = ApplyBasicQueryCasting<T> | QuerySelector<ApplyBasicQueryCasting<T>>;
|
6 |
|
7 | type _FilterQuery<T> = {
|
8 | [P in keyof T]?: Condition<T[P]>;
|
9 | } & RootQuerySelector<T>;
|
10 |
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | type FilterQuery<T> = _FilterQuery<T>;
|
19 |
|
20 | type MongooseQueryOptions<DocType = unknown> = Pick<QueryOptions<DocType>, 'populate' | 'lean' | 'strict' | 'sanitizeProjection' | 'sanitizeFilter'>;
|
21 |
|
22 | type ProjectionFields<DocType> = { [Key in keyof Omit<LeanDocument<DocType>, '__v'>]?: any } & Record<string, any>;
|
23 |
|
24 | type QueryWithHelpers<ResultType, DocType, THelpers = {}, RawDocType = DocType> = Query<ResultType, DocType, THelpers, RawDocType> & THelpers;
|
25 |
|
26 | type QuerySelector<T> = {
|
27 |
|
28 | $eq?: T;
|
29 | $gt?: T;
|
30 | $gte?: T;
|
31 | $in?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[];
|
32 | $lt?: T;
|
33 | $lte?: T;
|
34 | $ne?: T;
|
35 | $nin?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[];
|
36 |
|
37 | $not?: T extends string ? QuerySelector<T> | RegExp : QuerySelector<T>;
|
38 |
|
39 | |
40 |
|
41 |
|
42 |
|
43 | $exists?: boolean;
|
44 | $type?: string | number;
|
45 |
|
46 | $expr?: any;
|
47 | $jsonSchema?: any;
|
48 | $mod?: T extends number ? [number, number] : never;
|
49 | $regex?: T extends string ? RegExp | string : never;
|
50 | $options?: T extends string ? string : never;
|
51 |
|
52 |
|
53 | $geoIntersects?: { $geometry: object };
|
54 | $geoWithin?: object;
|
55 | $near?: object;
|
56 | $nearSphere?: object;
|
57 | $maxDistance?: number;
|
58 |
|
59 |
|
60 | $all?: T extends AnyArray<any> ? any[] : never;
|
61 | $elemMatch?: T extends AnyArray<any> ? object : never;
|
62 | $size?: T extends AnyArray<any> ? number : never;
|
63 |
|
64 | $bitsAllClear?: number | mongodb.Binary | number[];
|
65 | $bitsAllSet?: number | mongodb.Binary | number[];
|
66 | $bitsAnyClear?: number | mongodb.Binary | number[];
|
67 | $bitsAnySet?: number | mongodb.Binary | number[];
|
68 | };
|
69 |
|
70 | type RootQuerySelector<T> = {
|
71 |
|
72 | $and?: Array<FilterQuery<T>>;
|
73 |
|
74 | $nor?: Array<FilterQuery<T>>;
|
75 |
|
76 | $or?: Array<FilterQuery<T>>;
|
77 |
|
78 | $text?: {
|
79 | $search: string;
|
80 | $language?: string;
|
81 | $caseSensitive?: boolean;
|
82 | $diacriticSensitive?: boolean;
|
83 | };
|
84 |
|
85 | $where?: string | Function;
|
86 |
|
87 | $comment?: string;
|
88 |
|
89 |
|
90 | [key: string]: any;
|
91 | };
|
92 |
|
93 | interface QueryTimestampsConfig {
|
94 | createdAt?: boolean;
|
95 | updatedAt?: boolean;
|
96 | }
|
97 |
|
98 | interface QueryOptions<DocType = unknown> extends
|
99 | PopulateOption,
|
100 | SessionOption {
|
101 | arrayFilters?: { [key: string]: any }[];
|
102 | batchSize?: number;
|
103 | collation?: mongodb.CollationOptions;
|
104 | comment?: any;
|
105 | context?: string;
|
106 | explain?: mongodb.ExplainVerbosityLike;
|
107 | fields?: any | string;
|
108 | hint?: mongodb.Hint;
|
109 | |
110 |
|
111 |
|
112 | lean?: boolean | any;
|
113 | limit?: number;
|
114 | maxTimeMS?: number;
|
115 | maxscan?: number;
|
116 | multi?: boolean;
|
117 | multipleCastError?: boolean;
|
118 | |
119 |
|
120 |
|
121 |
|
122 |
|
123 | new?: boolean;
|
124 | overwrite?: boolean;
|
125 | overwriteDiscriminatorKey?: boolean;
|
126 | projection?: ProjectionType<DocType>;
|
127 | |
128 |
|
129 |
|
130 | rawResult?: boolean;
|
131 | readPreference?: string | mongodb.ReadPreferenceMode;
|
132 | |
133 |
|
134 |
|
135 | returnOriginal?: boolean;
|
136 | |
137 |
|
138 |
|
139 | returnDocument?: string;
|
140 | runValidators?: boolean;
|
141 |
|
142 | sanitizeProjection?: boolean;
|
143 | |
144 |
|
145 |
|
146 |
|
147 | sanitizeFilter?: boolean;
|
148 | setDefaultsOnInsert?: boolean;
|
149 | skip?: number;
|
150 | snapshot?: any;
|
151 | sort?: any;
|
152 |
|
153 | strict?: boolean | string;
|
154 | |
155 |
|
156 |
|
157 |
|
158 | strictQuery?: boolean | 'throw';
|
159 | tailable?: number;
|
160 | |
161 |
|
162 |
|
163 |
|
164 |
|
165 | timestamps?: boolean | QueryTimestampsConfig;
|
166 | upsert?: boolean;
|
167 | writeConcern?: mongodb.WriteConcern;
|
168 |
|
169 | [other: string]: any;
|
170 | }
|
171 |
|
172 | class Query<ResultType, DocType, THelpers = {}, RawDocType = DocType> implements SessionOperation {
|
173 | _mongooseOptions: MongooseQueryOptions<DocType>;
|
174 |
|
175 | |
176 |
|
177 |
|
178 |
|
179 |
|
180 | [Symbol.asyncIterator](): AsyncIterableIterator<DocType>;
|
181 |
|
182 |
|
183 | exec(callback: Callback<ResultType>): void;
|
184 | exec(): Promise<ResultType>;
|
185 |
|
186 | $where(argument: string | Function): QueryWithHelpers<DocType[], DocType, THelpers, RawDocType>;
|
187 |
|
188 |
|
189 | all(path: string, val: Array<any>): this;
|
190 | all(val: Array<any>): this;
|
191 |
|
192 |
|
193 | allowDiskUse(value: boolean): this;
|
194 |
|
195 |
|
196 | and(array: FilterQuery<DocType>[]): this;
|
197 |
|
198 |
|
199 | batchSize(val: number): this;
|
200 |
|
201 |
|
202 | box(lower: number[], upper: number[]): this;
|
203 | box(val: any): this;
|
204 |
|
205 | |
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | cast(model?: Model<any, THelpers> | null, obj?: any): any;
|
213 |
|
214 | |
215 |
|
216 |
|
217 |
|
218 |
|
219 | catch: Promise<ResultType>['catch'];
|
220 |
|
221 |
|
222 | circle(path: string, area: any): this;
|
223 | circle(area: any): this;
|
224 |
|
225 |
|
226 | clone(): this;
|
227 |
|
228 |
|
229 | collation(value: mongodb.CollationOptions): this;
|
230 |
|
231 |
|
232 | comment(val: string): this;
|
233 |
|
234 |
|
235 | count(criteria: FilterQuery<DocType>, callback?: Callback<number>): QueryWithHelpers<number, DocType, THelpers, RawDocType>;
|
236 | count(callback?: Callback<number>): QueryWithHelpers<number, DocType, THelpers, RawDocType>;
|
237 |
|
238 |
|
239 | countDocuments(
|
240 | criteria: FilterQuery<DocType>,
|
241 | options?: QueryOptions<DocType>,
|
242 | callback?: Callback<number>
|
243 | ): QueryWithHelpers<number, DocType, THelpers, RawDocType>;
|
244 | countDocuments(callback?: Callback<number>): QueryWithHelpers<number, DocType, THelpers, RawDocType>;
|
245 |
|
246 | |
247 |
|
248 |
|
249 |
|
250 | cursor(options?: QueryOptions<DocType>): Cursor<DocType, QueryOptions<DocType>>;
|
251 |
|
252 | |
253 |
|
254 |
|
255 |
|
256 |
|
257 | deleteMany(filter?: FilterQuery<DocType>, options?: QueryOptions<DocType>, callback?: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
258 | deleteMany(filter: FilterQuery<DocType>, callback: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
259 | deleteMany(callback: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
260 |
|
261 | |
262 |
|
263 |
|
264 |
|
265 |
|
266 | deleteOne(filter?: FilterQuery<DocType>, options?: QueryOptions<DocType>, callback?: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
267 | deleteOne(filter: FilterQuery<DocType>, callback: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
268 | deleteOne(callback: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
269 |
|
270 |
|
271 | distinct<ReturnType = any>(field: string, filter?: FilterQuery<DocType>, callback?: Callback<number>): QueryWithHelpers<Array<ReturnType>, DocType, THelpers, RawDocType>;
|
272 |
|
273 |
|
274 | elemMatch<K = string>(path: K, val: any): this;
|
275 | elemMatch(val: Function | any): this;
|
276 |
|
277 | |
278 |
|
279 |
|
280 |
|
281 | error(): NativeError | null;
|
282 | error(val: NativeError | null): this;
|
283 |
|
284 |
|
285 | equals(val: any): this;
|
286 |
|
287 |
|
288 | estimatedDocumentCount(options?: QueryOptions<DocType>, callback?: Callback<number>): QueryWithHelpers<number, DocType, THelpers, RawDocType>;
|
289 |
|
290 |
|
291 | exists<K = string>(path: K, val: boolean): this;
|
292 | exists(val: boolean): this;
|
293 |
|
294 | |
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | explain(verbose?: mongodb.ExplainVerbosityLike): this;
|
301 |
|
302 |
|
303 | find(
|
304 | filter: FilterQuery<DocType>,
|
305 | projection?: ProjectionType<DocType> | null,
|
306 | options?: QueryOptions<DocType> | null,
|
307 | callback?: Callback<DocType[]>
|
308 | ): QueryWithHelpers<Array<DocType>, DocType, THelpers, RawDocType>;
|
309 | find(
|
310 | filter: FilterQuery<DocType>,
|
311 | projection?: ProjectionType<DocType> | null,
|
312 | callback?: Callback<DocType[]>
|
313 | ): QueryWithHelpers<Array<DocType>, DocType, THelpers, RawDocType>;
|
314 | find(
|
315 | filter: FilterQuery<DocType>,
|
316 | callback?: Callback<DocType[]>
|
317 | ): QueryWithHelpers<Array<DocType>, DocType, THelpers, RawDocType>;
|
318 | find(callback?: Callback<DocType[]>): QueryWithHelpers<Array<DocType>, DocType, THelpers, RawDocType>;
|
319 |
|
320 |
|
321 | findOne(
|
322 | filter?: FilterQuery<DocType>,
|
323 | projection?: ProjectionType<DocType> | null,
|
324 | options?: QueryOptions<DocType> | null,
|
325 | callback?: Callback<DocType | null>
|
326 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
327 | findOne(
|
328 | filter?: FilterQuery<DocType>,
|
329 | projection?: ProjectionType<DocType> | null,
|
330 | callback?: Callback<DocType | null>
|
331 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
332 | findOne(
|
333 | filter?: FilterQuery<DocType>,
|
334 | callback?: Callback<DocType | null>
|
335 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
336 |
|
337 |
|
338 | findOneAndDelete(
|
339 | filter?: FilterQuery<DocType>,
|
340 | options?: QueryOptions<DocType> | null,
|
341 | callback?: (err: CallbackError, doc: DocType | null, res: any) => void
|
342 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
343 |
|
344 |
|
345 | findOneAndRemove(
|
346 | filter?: FilterQuery<DocType>,
|
347 | options?: QueryOptions<DocType> | null,
|
348 | callback?: (err: CallbackError, doc: DocType | null, res: any) => void
|
349 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
350 |
|
351 |
|
352 | findOneAndUpdate(
|
353 | filter: FilterQuery<DocType>,
|
354 | update: UpdateQuery<DocType>,
|
355 | options: QueryOptions<DocType> & { rawResult: true },
|
356 | callback?: (err: CallbackError, doc: DocType | null, res: ModifyResult<DocType>) => void
|
357 | ): QueryWithHelpers<ModifyResult<DocType>, DocType, THelpers, RawDocType>;
|
358 | findOneAndUpdate(
|
359 | filter: FilterQuery<DocType>,
|
360 | update: UpdateQuery<DocType>,
|
361 | options: QueryOptions<DocType> & { upsert: true } & ReturnsNewDoc,
|
362 | callback?: (err: CallbackError, doc: DocType, res: ModifyResult<DocType>) => void
|
363 | ): QueryWithHelpers<DocType, DocType, THelpers, RawDocType>;
|
364 | findOneAndUpdate(
|
365 | filter?: FilterQuery<DocType>,
|
366 | update?: UpdateQuery<DocType>,
|
367 | options?: QueryOptions<DocType> | null,
|
368 | callback?: (err: CallbackError, doc: DocType | null, res: ModifyResult<DocType>) => void
|
369 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
370 |
|
371 |
|
372 | findById(
|
373 | id: mongodb.ObjectId | any,
|
374 | projection?: ProjectionType<DocType> | null,
|
375 | options?: QueryOptions<DocType> | null,
|
376 | callback?: Callback<DocType | null>
|
377 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
378 | findById(
|
379 | id: mongodb.ObjectId | any,
|
380 | projection?: ProjectionType<DocType> | null,
|
381 | callback?: Callback<DocType | null>
|
382 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
383 | findById(
|
384 | id: mongodb.ObjectId | any,
|
385 | callback?: Callback<DocType | null>
|
386 | ): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
387 |
|
388 |
|
389 | findByIdAndDelete(id?: mongodb.ObjectId | any, options?: QueryOptions<DocType> | null, callback?: (err: CallbackError, doc: DocType | null, res: any) => void): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
390 |
|
391 |
|
392 | findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery<DocType>, options: QueryOptions<DocType> & { rawResult: true }, callback?: (err: CallbackError, doc: any, res?: any) => void): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
393 | findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery<DocType>, options: QueryOptions<DocType> & { upsert: true } & ReturnsNewDoc, callback?: (err: CallbackError, doc: DocType, res?: any) => void): QueryWithHelpers<DocType, DocType, THelpers, RawDocType>;
|
394 | findByIdAndUpdate(id?: mongodb.ObjectId | any, update?: UpdateQuery<DocType>, options?: QueryOptions<DocType> | null, callback?: (CallbackError: any, doc: DocType | null, res?: any) => void): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
395 | findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery<DocType>, callback: (CallbackError: any, doc: DocType | null, res?: any) => void): QueryWithHelpers<DocType | null, DocType, THelpers, RawDocType>;
|
396 |
|
397 |
|
398 | geometry(object: { type: string, coordinates: any[] }): this;
|
399 |
|
400 | |
401 |
|
402 |
|
403 |
|
404 |
|
405 | get(path: string): any;
|
406 |
|
407 |
|
408 | getFilter(): FilterQuery<DocType>;
|
409 |
|
410 |
|
411 | getOptions(): QueryOptions<DocType>;
|
412 |
|
413 |
|
414 | getPopulatedPaths(): Array<string>;
|
415 |
|
416 |
|
417 | getQuery(): FilterQuery<DocType>;
|
418 |
|
419 |
|
420 | getUpdate(): UpdateQuery<DocType> | UpdateWithAggregationPipeline | null;
|
421 |
|
422 |
|
423 | gt<K = string>(path: K, val: any): this;
|
424 | gt(val: number): this;
|
425 |
|
426 |
|
427 | gte<K = string>(path: K, val: any): this;
|
428 | gte(val: number): this;
|
429 |
|
430 |
|
431 | hint(val: any): this;
|
432 |
|
433 |
|
434 | in<K = string>(path: K, val: any[]): this;
|
435 | in(val: Array<any>): this;
|
436 |
|
437 |
|
438 | intersects(arg?: any): this;
|
439 |
|
440 |
|
441 | j(val: boolean | null): this;
|
442 |
|
443 |
|
444 | lean<LeanResultType = RawDocType extends Document ? LeanDocumentOrArray<ResultType> : LeanDocumentOrArrayWithRawType<ResultType, Require_id<RawDocType>>>(val?: boolean | any): QueryWithHelpers<LeanResultType, DocType, THelpers, RawDocType>;
|
445 |
|
446 |
|
447 | limit(val: number): this;
|
448 |
|
449 |
|
450 | lt<K = string>(path: K, val: any): this;
|
451 | lt(val: number): this;
|
452 |
|
453 |
|
454 | lte<K = string>(path: K, val: any): this;
|
455 | lte(val: number): this;
|
456 |
|
457 | |
458 |
|
459 |
|
460 |
|
461 | transform<MappedType>(fn: (doc: ResultType) => MappedType): QueryWithHelpers<MappedType, DocType, THelpers, RawDocType>;
|
462 |
|
463 | /** Specifies an `$maxDistance` query condition. When called with one argument, the most recent path passed to `where()` is used. */
|
464 | maxDistance(path: string, val: number): this;
|
465 | maxDistance(val: number): this;
|
466 |
|
467 | /** Specifies the maxScan option. */
|
468 | maxScan(val: number): this;
|
469 |
|
470 | /**
|
471 | * Sets the [maxTimeMS](https:
|
472 | * option. This will tell the MongoDB server to abort if the query or write op
|
473 | * has been running for more than `ms` milliseconds.
|
474 | */
|
475 | maxTimeMS(ms: number): this;
|
476 |
|
477 |
|
478 | merge(source: Query<any, any> | FilterQuery<DocType>): this;
|
479 |
|
480 |
|
481 | mod<K = string>(path: K, val: number): this;
|
482 | mod(val: Array<number>): this;
|
483 |
|
484 |
|
485 | model: typeof Model;
|
486 |
|
487 | |
488 |
|
489 |
|
490 |
|
491 | mongooseOptions(val?: MongooseQueryOptions): MongooseQueryOptions;
|
492 |
|
493 |
|
494 | ne<K = string>(path: K, val: any): this;
|
495 | ne(val: any): this;
|
496 |
|
497 |
|
498 | near<K = string>(path: K, val: any): this;
|
499 | near(val: any): this;
|
500 |
|
501 |
|
502 | nin<K = string>(path: K, val: any[]): this;
|
503 | nin(val: Array<any>): this;
|
504 |
|
505 |
|
506 | nor(array: Array<FilterQuery<DocType>>): this;
|
507 |
|
508 |
|
509 | or(array: Array<FilterQuery<DocType>>): this;
|
510 |
|
511 | |
512 |
|
513 |
|
514 |
|
515 |
|
516 | orFail(err?: NativeError | (() => NativeError)): QueryWithHelpers<NonNullable<ResultType>, DocType, THelpers, RawDocType>;
|
517 |
|
518 |
|
519 | polygon(path: string, ...coordinatePairs: number[][]): this;
|
520 | polygon(...coordinatePairs: number[][]): this;
|
521 |
|
522 |
|
523 | populate<Paths = {}>(path: string | string[], select?: string | any, model?: string | Model<any, THelpers>, match?: any): QueryWithHelpers<UnpackedIntersection<ResultType, Paths>, DocType, THelpers, UnpackedIntersection<RawDocType, Paths>>;
|
524 | populate<Paths = {}>(options: PopulateOptions | (PopulateOptions | string)[]): QueryWithHelpers<UnpackedIntersection<ResultType, Paths>, DocType, THelpers, UnpackedIntersection<RawDocType, Paths>>;
|
525 |
|
526 |
|
527 | projection(fields?: ProjectionFields<DocType> | string): ProjectionFields<DocType>;
|
528 | projection(fields: null): null;
|
529 | projection(): ProjectionFields<DocType> | null;
|
530 |
|
531 |
|
532 | read(pref: string | mongodb.ReadPreferenceMode, tags?: any[]): this;
|
533 |
|
534 |
|
535 | readConcern(level: string): this;
|
536 |
|
537 |
|
538 | regex<K = string>(path: K, val: RegExp): this;
|
539 | regex(val: string | RegExp): this;
|
540 |
|
541 | |
542 |
|
543 |
|
544 |
|
545 |
|
546 | remove(filter?: FilterQuery<DocType>, callback?: Callback<mongodb.UpdateResult>): Query<mongodb.UpdateResult, DocType, THelpers, RawDocType>;
|
547 |
|
548 | |
549 |
|
550 |
|
551 |
|
552 |
|
553 | replaceOne(filter?: FilterQuery<DocType>, replacement?: DocType | AnyObject, options?: QueryOptions<DocType> | null, callback?: Callback): QueryWithHelpers<any, DocType, THelpers, RawDocType>;
|
554 |
|
555 |
|
556 | select(arg: string | any): this;
|
557 |
|
558 |
|
559 | selected(): boolean;
|
560 |
|
561 |
|
562 | selectedExclusively(): boolean;
|
563 |
|
564 |
|
565 | selectedInclusively(): boolean;
|
566 |
|
567 | |
568 |
|
569 |
|
570 |
|
571 |
|
572 | session(session: mongodb.ClientSession | null): this;
|
573 |
|
574 | |
575 |
|
576 |
|
577 |
|
578 |
|
579 | set(path: string | Record<string, unknown>, value?: any): this;
|
580 |
|
581 |
|
582 | setOptions(options: QueryOptions<DocType>, overwrite?: boolean): this;
|
583 |
|
584 |
|
585 | setQuery(val: FilterQuery<DocType> | null): void;
|
586 |
|
587 | setUpdate(update: UpdateQuery<DocType> | UpdateWithAggregationPipeline): void;
|
588 |
|
589 |
|
590 | size<K = string>(path: K, val: number): this;
|
591 | size(val: number): this;
|
592 |
|
593 |
|
594 | skip(val: number): this;
|
595 |
|
596 |
|
597 | slice(path: string, val: number | Array<number>): this;
|
598 | slice(val: number | Array<number>): this;
|
599 |
|
600 |
|
601 | snapshot(val?: boolean): this;
|
602 |
|
603 |
|
604 | sort(arg?: string | { [key: string]: SortOrder | { $meta: 'textScore' } } | [string, SortOrder][] | undefined | null): this;
|
605 |
|
606 |
|
607 | tailable(bool?: boolean, opts?: {
|
608 | numberOfRetries?: number;
|
609 | tailableRetryInterval?: number;
|
610 | }): this;
|
611 |
|
612 | |
613 |
|
614 |
|
615 |
|
616 | then: Promise<ResultType>['then'];
|
617 |
|
618 |
|
619 | toConstructor(): typeof this;
|
620 |
|
621 |
|
622 | update(filter?: FilterQuery<DocType>, update?: UpdateQuery<DocType> | UpdateWithAggregationPipeline, options?: QueryOptions<DocType> | null, callback?: Callback<UpdateWriteOpResult>): QueryWithHelpers<UpdateWriteOpResult, DocType, THelpers, RawDocType>;
|
623 |
|
624 | |
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 | updateMany(filter?: FilterQuery<DocType>, update?: UpdateQuery<DocType> | UpdateWithAggregationPipeline, options?: QueryOptions<DocType> | null, callback?: Callback<UpdateWriteOpResult>): QueryWithHelpers<UpdateWriteOpResult, DocType, THelpers, RawDocType>;
|
631 |
|
632 | |
633 |
|
634 |
|
635 |
|
636 | updateOne(filter?: FilterQuery<DocType>, update?: UpdateQuery<DocType> | UpdateWithAggregationPipeline, options?: QueryOptions<DocType> | null, callback?: Callback<UpdateWriteOpResult>): QueryWithHelpers<UpdateWriteOpResult, DocType, THelpers, RawDocType>;
|
637 |
|
638 | |
639 |
|
640 |
|
641 |
|
642 | w(val: string | number | null): this;
|
643 |
|
644 |
|
645 | where(path: string, val?: any): this;
|
646 | where(obj: object): this;
|
647 | where(): this;
|
648 |
|
649 |
|
650 | within(val?: any): this;
|
651 |
|
652 | |
653 |
|
654 |
|
655 |
|
656 |
|
657 | wtimeout(ms: number): this;
|
658 | }
|
659 | }
|
660 |
|
\ | No newline at end of file |