mongoose 7.4.3 → 7.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.umd.js +1 -1
- package/lib/connection.js +49 -32
- package/lib/cursor/ChangeStream.js +13 -2
- package/lib/drivers/node-mongodb-native/collection.js +2 -1
- package/lib/helpers/query/selectPopulatedFields.js +13 -0
- package/lib/helpers/schema/getIndexes.js +9 -1
- package/lib/model.js +5 -3
- package/lib/schema/SubdocumentPath.js +3 -1
- package/lib/schema.js +8 -0
- package/package.json +1 -1
- package/types/document.d.ts +12 -0
- package/types/inferschematype.d.ts +2 -2
- package/types/models.d.ts +15 -0
package/lib/connection.js
CHANGED
|
@@ -517,49 +517,66 @@ Connection.prototype.startSession = async function startSession(options) {
|
|
|
517
517
|
Connection.prototype.transaction = function transaction(fn, options) {
|
|
518
518
|
return this.startSession().then(session => {
|
|
519
519
|
session[sessionNewDocuments] = new Map();
|
|
520
|
-
return session.withTransaction(() => fn
|
|
520
|
+
return session.withTransaction(() => _wrapUserTransaction(fn, session), options).
|
|
521
521
|
then(res => {
|
|
522
522
|
delete session[sessionNewDocuments];
|
|
523
523
|
return res;
|
|
524
524
|
}).
|
|
525
525
|
catch(err => {
|
|
526
|
-
// If transaction was aborted, we need to reset newly
|
|
527
|
-
// inserted documents' `isNew`.
|
|
528
|
-
for (const doc of session[sessionNewDocuments].keys()) {
|
|
529
|
-
const state = session[sessionNewDocuments].get(doc);
|
|
530
|
-
if (state.hasOwnProperty('isNew')) {
|
|
531
|
-
doc.$isNew = state.$isNew;
|
|
532
|
-
}
|
|
533
|
-
if (state.hasOwnProperty('versionKey')) {
|
|
534
|
-
doc.set(doc.schema.options.versionKey, state.versionKey);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
if (state.modifiedPaths.length > 0 && doc.$__.activePaths.states.modify == null) {
|
|
538
|
-
doc.$__.activePaths.states.modify = {};
|
|
539
|
-
}
|
|
540
|
-
for (const path of state.modifiedPaths) {
|
|
541
|
-
doc.$__.activePaths.paths[path] = 'modify';
|
|
542
|
-
doc.$__.activePaths.states.modify[path] = true;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
for (const path of state.atomics.keys()) {
|
|
546
|
-
const val = doc.$__getValue(path);
|
|
547
|
-
if (val == null) {
|
|
548
|
-
continue;
|
|
549
|
-
}
|
|
550
|
-
val[arrayAtomicsSymbol] = state.atomics.get(path);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
526
|
delete session[sessionNewDocuments];
|
|
554
527
|
throw err;
|
|
555
|
-
})
|
|
556
|
-
|
|
557
|
-
session.endSession()
|
|
558
|
-
.catch(() => {});
|
|
528
|
+
}).
|
|
529
|
+
finally(() => {
|
|
530
|
+
session.endSession().catch(() => {});
|
|
559
531
|
});
|
|
560
532
|
});
|
|
561
533
|
};
|
|
562
534
|
|
|
535
|
+
/*!
|
|
536
|
+
* Reset document state in between transaction retries re: gh-13698
|
|
537
|
+
*/
|
|
538
|
+
|
|
539
|
+
async function _wrapUserTransaction(fn, session) {
|
|
540
|
+
try {
|
|
541
|
+
const res = await fn(session);
|
|
542
|
+
return res;
|
|
543
|
+
} catch (err) {
|
|
544
|
+
_resetSessionDocuments(session);
|
|
545
|
+
throw err;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/*!
|
|
550
|
+
* If transaction was aborted, we need to reset newly inserted documents' `isNew`.
|
|
551
|
+
*/
|
|
552
|
+
function _resetSessionDocuments(session) {
|
|
553
|
+
for (const doc of session[sessionNewDocuments].keys()) {
|
|
554
|
+
const state = session[sessionNewDocuments].get(doc);
|
|
555
|
+
if (state.hasOwnProperty('isNew')) {
|
|
556
|
+
doc.$isNew = state.isNew;
|
|
557
|
+
}
|
|
558
|
+
if (state.hasOwnProperty('versionKey')) {
|
|
559
|
+
doc.set(doc.schema.options.versionKey, state.versionKey);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (state.modifiedPaths.length > 0 && doc.$__.activePaths.states.modify == null) {
|
|
563
|
+
doc.$__.activePaths.states.modify = {};
|
|
564
|
+
}
|
|
565
|
+
for (const path of state.modifiedPaths) {
|
|
566
|
+
doc.$__.activePaths.paths[path] = 'modify';
|
|
567
|
+
doc.$__.activePaths.states.modify[path] = true;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
for (const path of state.atomics.keys()) {
|
|
571
|
+
const val = doc.$__getValue(path);
|
|
572
|
+
if (val == null) {
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
val[arrayAtomicsSymbol] = state.atomics.get(path);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
563
580
|
/**
|
|
564
581
|
* Helper for `dropCollection()`. Will delete the given collection, including
|
|
565
582
|
* all documents and indexes.
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
const EventEmitter = require('events').EventEmitter;
|
|
8
8
|
|
|
9
|
+
/*!
|
|
10
|
+
* ignore
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const driverChangeStreamEvents = ['close', 'change', 'end', 'error', 'resumeTokenChanged'];
|
|
14
|
+
|
|
9
15
|
/*!
|
|
10
16
|
* ignore
|
|
11
17
|
*/
|
|
@@ -52,7 +58,7 @@ class ChangeStream extends EventEmitter {
|
|
|
52
58
|
this.closed = true;
|
|
53
59
|
});
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
driverChangeStreamEvents.forEach(ev => {
|
|
56
62
|
this.driverChangeStream.on(ev, data => {
|
|
57
63
|
// Sometimes Node driver still polls after close, so
|
|
58
64
|
// avoid any uncaught exceptions due to closed change streams
|
|
@@ -75,7 +81,7 @@ class ChangeStream extends EventEmitter {
|
|
|
75
81
|
this.closed = true;
|
|
76
82
|
});
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
driverChangeStreamEvents.forEach(ev => {
|
|
79
85
|
this.driverChangeStream.on(ev, data => {
|
|
80
86
|
// Sometimes Node driver still polls after close, so
|
|
81
87
|
// avoid any uncaught exceptions due to closed change streams
|
|
@@ -122,6 +128,11 @@ class ChangeStream extends EventEmitter {
|
|
|
122
128
|
return this.driverChangeStream.next(cb);
|
|
123
129
|
}
|
|
124
130
|
|
|
131
|
+
addListener(event, handler) {
|
|
132
|
+
this._bindEvents();
|
|
133
|
+
return super.addListener(event, handler);
|
|
134
|
+
}
|
|
135
|
+
|
|
125
136
|
on(event, handler) {
|
|
126
137
|
this._bindEvents();
|
|
127
138
|
return super.on(event, handler);
|
|
@@ -9,6 +9,7 @@ const MongooseError = require('../../error/mongooseError');
|
|
|
9
9
|
const Collection = require('mongodb').Collection;
|
|
10
10
|
const ObjectId = require('../../types/objectid');
|
|
11
11
|
const getConstructorName = require('../../helpers/getConstructorName');
|
|
12
|
+
const internalToObjectOptions = require('../../options').internalToObjectOptions;
|
|
12
13
|
const stream = require('stream');
|
|
13
14
|
const util = require('util');
|
|
14
15
|
|
|
@@ -377,7 +378,7 @@ function format(obj, sub, color, shell) {
|
|
|
377
378
|
}
|
|
378
379
|
|
|
379
380
|
const clone = require('../../helpers/clone');
|
|
380
|
-
let x = clone(obj,
|
|
381
|
+
let x = clone(obj, internalToObjectOptions);
|
|
381
382
|
const constructorName = getConstructorName(x);
|
|
382
383
|
|
|
383
384
|
if (constructorName === 'Binary') {
|
|
@@ -21,12 +21,25 @@ module.exports = function selectPopulatedFields(fields, userProvidedFields, popu
|
|
|
21
21
|
} else if (userProvidedFields[path] === 0) {
|
|
22
22
|
delete fields[path];
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
const refPath = populateOptions[path]?.refPath;
|
|
26
|
+
if (typeof refPath === 'string') {
|
|
27
|
+
if (!isPathInFields(userProvidedFields, refPath)) {
|
|
28
|
+
fields[refPath] = 1;
|
|
29
|
+
} else if (userProvidedFields[refPath] === 0) {
|
|
30
|
+
delete fields[refPath];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
}
|
|
25
34
|
} else if (isExclusive(fields)) {
|
|
26
35
|
for (const path of paths) {
|
|
27
36
|
if (userProvidedFields[path] == null) {
|
|
28
37
|
delete fields[path];
|
|
29
38
|
}
|
|
39
|
+
const refPath = populateOptions[path]?.refPath;
|
|
40
|
+
if (typeof refPath === 'string' && userProvidedFields[refPath] == null) {
|
|
41
|
+
delete fields[refPath];
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
44
|
}
|
|
32
45
|
};
|
|
@@ -78,7 +78,15 @@ module.exports = function getIndexes(schema) {
|
|
|
78
78
|
field[prefix + key] = 'text';
|
|
79
79
|
delete options.text;
|
|
80
80
|
} else {
|
|
81
|
-
|
|
81
|
+
let isDescendingIndex = false;
|
|
82
|
+
if (index === 'descending' || index === 'desc') {
|
|
83
|
+
isDescendingIndex = true;
|
|
84
|
+
} else if (index === 'ascending' || index === 'asc') {
|
|
85
|
+
isDescendingIndex = false;
|
|
86
|
+
} else {
|
|
87
|
+
isDescendingIndex = Number(index) === -1;
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
field[prefix + key] = isDescendingIndex ? -1 : 1;
|
|
83
91
|
}
|
|
84
92
|
|
package/lib/model.js
CHANGED
|
@@ -1481,9 +1481,7 @@ Model.syncIndexes = async function syncIndexes(options) {
|
|
|
1481
1481
|
};
|
|
1482
1482
|
|
|
1483
1483
|
/**
|
|
1484
|
-
* Does a dry-run of Model.syncIndexes()
|
|
1485
|
-
* the result of this function would be the result of
|
|
1486
|
-
* Model.syncIndexes().
|
|
1484
|
+
* Does a dry-run of `Model.syncIndexes()`, returning the indexes that `syncIndexes()` would drop and create if you were to run `syncIndexes()`.
|
|
1487
1485
|
*
|
|
1488
1486
|
* @param {Object} [options]
|
|
1489
1487
|
* @returns {Promise} which contains an object, {toDrop, toCreate}, which
|
|
@@ -3498,6 +3496,10 @@ Model.bulkWrite = async function bulkWrite(ops, options) {
|
|
|
3498
3496
|
const validOpIndexes = validOps;
|
|
3499
3497
|
validOps = validOps.sort().map(index => ops[index]);
|
|
3500
3498
|
|
|
3499
|
+
if (validOps.length === 0) {
|
|
3500
|
+
return resolve(getDefaultBulkwriteResult());
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3501
3503
|
this.$__collection.bulkWrite(validOps, options, (error, res) => {
|
|
3502
3504
|
if (error) {
|
|
3503
3505
|
if (validationErrors.length > 0) {
|
|
@@ -17,6 +17,7 @@ const geospatial = require('./operators/geospatial');
|
|
|
17
17
|
const getConstructor = require('../helpers/discriminator/getConstructor');
|
|
18
18
|
const handleIdOption = require('../helpers/schema/handleIdOption');
|
|
19
19
|
const internalToObjectOptions = require('../options').internalToObjectOptions;
|
|
20
|
+
const isExclusive = require('../helpers/projection/isExclusive');
|
|
20
21
|
const utils = require('../utils');
|
|
21
22
|
const InvalidSchemaOptionError = require('../error/invalidSchemaOption');
|
|
22
23
|
|
|
@@ -178,7 +179,8 @@ SubdocumentPath.prototype.cast = function(val, doc, init, priorVal, options) {
|
|
|
178
179
|
subdoc = new Constructor(void 0, selected, doc, false, { defaults: false });
|
|
179
180
|
delete subdoc.$__.defaults;
|
|
180
181
|
subdoc.$init(val);
|
|
181
|
-
|
|
182
|
+
const exclude = isExclusive(selected);
|
|
183
|
+
applyDefaults(subdoc, selected, exclude);
|
|
182
184
|
} else {
|
|
183
185
|
options = Object.assign({}, options, { priorDoc: priorVal });
|
|
184
186
|
if (Object.keys(val).length === 0) {
|
package/lib/schema.js
CHANGED
|
@@ -2046,6 +2046,14 @@ Schema.prototype.index = function(fields, options) {
|
|
|
2046
2046
|
utils.expires(options);
|
|
2047
2047
|
}
|
|
2048
2048
|
|
|
2049
|
+
for (const field of Object.keys(fields)) {
|
|
2050
|
+
if (fields[field] === 'ascending' || fields[field] === 'asc') {
|
|
2051
|
+
fields[field] = 1;
|
|
2052
|
+
} else if (fields[field] === 'descending' || fields[field] === 'desc') {
|
|
2053
|
+
fields[field] = -1;
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2049
2057
|
this._indexes.push([fields, options]);
|
|
2050
2058
|
return this;
|
|
2051
2059
|
};
|
package/package.json
CHANGED
package/types/document.d.ts
CHANGED
|
@@ -135,6 +135,7 @@ declare module 'mongoose' {
|
|
|
135
135
|
errors?: Error.ValidationError;
|
|
136
136
|
|
|
137
137
|
/** Returns the value of a path. */
|
|
138
|
+
get<T extends keyof DocType>(path: T, type?: any, options?: any): DocType[T];
|
|
138
139
|
get(path: string, type?: any, options?: any): any;
|
|
139
140
|
|
|
140
141
|
/**
|
|
@@ -157,30 +158,37 @@ declare module 'mongoose' {
|
|
|
157
158
|
init(obj: AnyObject, opts?: AnyObject): this;
|
|
158
159
|
|
|
159
160
|
/** Marks a path as invalid, causing validation to fail. */
|
|
161
|
+
invalidate<T extends keyof DocType>(path: T, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
|
|
160
162
|
invalidate(path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
|
|
161
163
|
|
|
162
164
|
/** Returns true if `path` was directly set and modified, else false. */
|
|
165
|
+
isDirectModified<T extends keyof DocType>(path: T | Array<T>): boolean;
|
|
163
166
|
isDirectModified(path: string | Array<string>): boolean;
|
|
164
167
|
|
|
165
168
|
/** Checks if `path` was explicitly selected. If no projection, always returns true. */
|
|
169
|
+
isDirectSelected<T extends keyof DocType>(path: T): boolean;
|
|
166
170
|
isDirectSelected(path: string): boolean;
|
|
167
171
|
|
|
168
172
|
/** Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since. */
|
|
173
|
+
isInit<T extends keyof DocType>(path: T): boolean;
|
|
169
174
|
isInit(path: string): boolean;
|
|
170
175
|
|
|
171
176
|
/**
|
|
172
177
|
* Returns true if any of the given paths are modified, else false. If no arguments, returns `true` if any path
|
|
173
178
|
* in this document is modified.
|
|
174
179
|
*/
|
|
180
|
+
isModified<T extends keyof DocType>(path?: T | Array<T>): boolean;
|
|
175
181
|
isModified(path?: string | Array<string>): boolean;
|
|
176
182
|
|
|
177
183
|
/** Boolean flag specifying if the document is new. */
|
|
178
184
|
isNew: boolean;
|
|
179
185
|
|
|
180
186
|
/** Checks if `path` was selected in the source query which initialized this document. */
|
|
187
|
+
isSelected<T extends keyof DocType>(path: T): boolean;
|
|
181
188
|
isSelected(path: string): boolean;
|
|
182
189
|
|
|
183
190
|
/** Marks the path as having pending changes to write to the db. */
|
|
191
|
+
markModified<T extends keyof DocType>(path: T, scope?: any): void;
|
|
184
192
|
markModified(path: string, scope?: any): void;
|
|
185
193
|
|
|
186
194
|
/** Returns the list of paths that have been modified. */
|
|
@@ -216,6 +224,7 @@ declare module 'mongoose' {
|
|
|
216
224
|
schema: Schema;
|
|
217
225
|
|
|
218
226
|
/** Sets the value of a path, or many paths. */
|
|
227
|
+
set<T extends keyof DocType>(path: T, val: DocType[T], type: any, options?: DocumentSetOptions): this;
|
|
219
228
|
set(path: string | Record<string, any>, val: any, type: any, options?: DocumentSetOptions): this;
|
|
220
229
|
set(path: string | Record<string, any>, val: any, options?: DocumentSetOptions): this;
|
|
221
230
|
set(value: string | Record<string, any>): this;
|
|
@@ -228,17 +237,20 @@ declare module 'mongoose' {
|
|
|
228
237
|
toObject<T = Require_id<DocType>>(options?: ToObjectOptions): Require_id<T>;
|
|
229
238
|
|
|
230
239
|
/** Clears the modified state on the specified path. */
|
|
240
|
+
unmarkModified<T extends keyof DocType>(path: T): void;
|
|
231
241
|
unmarkModified(path: string): void;
|
|
232
242
|
|
|
233
243
|
/** Sends an updateOne command with this document `_id` as the query selector. */
|
|
234
244
|
updateOne(update?: UpdateQuery<this> | UpdateWithAggregationPipeline, options?: QueryOptions | null): Query<any, this>;
|
|
235
245
|
|
|
236
246
|
/** Executes registered validation rules for this document. */
|
|
247
|
+
validate<T extends keyof DocType>(pathsToValidate?: T | T[], options?: AnyObject): Promise<void>;
|
|
237
248
|
validate(pathsToValidate?: pathsToValidate, options?: AnyObject): Promise<void>;
|
|
238
249
|
validate(options: { pathsToSkip?: pathsToSkip }): Promise<void>;
|
|
239
250
|
|
|
240
251
|
/** Executes registered validation rules (skipping asynchronous validators) for this document. */
|
|
241
252
|
validateSync(options: { pathsToSkip?: pathsToSkip, [k: string]: any }): Error.ValidationError | null;
|
|
253
|
+
validateSync<T extends keyof DocType>(pathsToValidate?: T | T[], options?: AnyObject): Error.ValidationError | null;
|
|
242
254
|
validateSync(pathsToValidate?: pathsToValidate, options?: AnyObject): Error.ValidationError | null;
|
|
243
255
|
}
|
|
244
256
|
}
|
|
@@ -30,7 +30,7 @@ declare module 'mongoose' {
|
|
|
30
30
|
OptionalPaths<DocDefinition, TSchemaOptions['typeKey']>)]: ObtainDocumentPathType<DocDefinition[K], TSchemaOptions['typeKey']>;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
34
|
* @summary Obtains document schema type from Schema instance.
|
|
35
35
|
* @param {Schema} TSchema `typeof` a schema instance.
|
|
36
36
|
* @example
|
|
@@ -39,7 +39,7 @@ declare module 'mongoose' {
|
|
|
39
39
|
* // result
|
|
40
40
|
* type UserType = {userName?: string}
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
export type InferSchemaType<TSchema> = IfAny<TSchema, any, ObtainSchemaGeneric<TSchema, 'DocType'>>;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* @summary Obtains schema Generic type by using generic alias.
|
package/types/models.d.ts
CHANGED
|
@@ -557,6 +557,11 @@ declare module 'mongoose' {
|
|
|
557
557
|
update: UpdateQuery<TRawDocType>,
|
|
558
558
|
options: QueryOptions<TRawDocType> & { rawResult: true }
|
|
559
559
|
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate'>;
|
|
560
|
+
findByIdAndUpdate<ResultDoc = THydratedDocumentType>(
|
|
561
|
+
id: mongodb.ObjectId | any,
|
|
562
|
+
update: UpdateQuery<TRawDocType>,
|
|
563
|
+
options: QueryOptions<TRawDocType> & { includeResultMetadata: true }
|
|
564
|
+
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate'>;
|
|
560
565
|
findByIdAndUpdate<ResultDoc = THydratedDocumentType>(
|
|
561
566
|
id: mongodb.ObjectId | any,
|
|
562
567
|
update: UpdateQuery<TRawDocType>,
|
|
@@ -611,6 +616,11 @@ declare module 'mongoose' {
|
|
|
611
616
|
replacement: TRawDocType | AnyObject,
|
|
612
617
|
options: QueryOptions<TRawDocType> & { rawResult: true }
|
|
613
618
|
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndReplace'>;
|
|
619
|
+
findOneAndReplace<ResultDoc = THydratedDocumentType>(
|
|
620
|
+
filter: FilterQuery<TRawDocType>,
|
|
621
|
+
replacement: TRawDocType | AnyObject,
|
|
622
|
+
options: QueryOptions<TRawDocType> & { includeResultMetadata: true }
|
|
623
|
+
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndReplace'>;
|
|
614
624
|
findOneAndReplace<ResultDoc = THydratedDocumentType>(
|
|
615
625
|
filter: FilterQuery<TRawDocType>,
|
|
616
626
|
replacement: TRawDocType | AnyObject,
|
|
@@ -639,6 +649,11 @@ declare module 'mongoose' {
|
|
|
639
649
|
update: UpdateQuery<TRawDocType>,
|
|
640
650
|
options: QueryOptions<TRawDocType> & { rawResult: true }
|
|
641
651
|
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate'>;
|
|
652
|
+
findOneAndUpdate<ResultDoc = THydratedDocumentType>(
|
|
653
|
+
filter: FilterQuery<TRawDocType>,
|
|
654
|
+
update: UpdateQuery<TRawDocType>,
|
|
655
|
+
options: QueryOptions<TRawDocType> & { includeResultMetadata: true }
|
|
656
|
+
): QueryWithHelpers<ModifyResult<ResultDoc>, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate'>;
|
|
642
657
|
findOneAndUpdate<ResultDoc = THydratedDocumentType>(
|
|
643
658
|
filter: FilterQuery<TRawDocType>,
|
|
644
659
|
update: UpdateQuery<TRawDocType>,
|