You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -273,3 +277,20 @@ function decideModelByObject(model, object) {
273
277
}
274
278
returnmodel;
275
279
}
280
+
281
+
282
+
/**
283
+
* gets timestamps option for a given operation. If the option is set within an individual operation, use it. Otherwise, use the global timestamps option configured in the `bulkWrite` options. Overall default is `true`.
Copy file name to clipboardExpand all lines: lib/model.js
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3467,6 +3467,7 @@ function _setIsNew(doc, val) {
3467
3467
*
3468
3468
* @param {Array} ops
3469
3469
* @param {Object} [ops.insertOne.document] The document to insert
3470
+
* @param {Object} [ops.insertOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation
3470
3471
* @param {Object} [ops.updateOne.filter] Update the first document that matches this filter
3471
3472
* @param {Object} [ops.updateOne.update] An object containing [update operators](https://www.mongodb.com/docs/manual/reference/operator/update/)
3472
3473
* @param {Boolean} [ops.updateOne.upsert=false] If true, insert a doc if none match
@@ -3484,8 +3485,10 @@ function _setIsNew(doc, val) {
3484
3485
* @param {Object} [ops.replaceOne.filter] Replace the first document that matches this filter
3485
3486
* @param {Object} [ops.replaceOne.replacement] The replacement document
3486
3487
* @param {Boolean} [ops.replaceOne.upsert=false] If true, insert a doc if no documents match `filter`
3488
+
* @param {Object} [ops.replaceOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation
3487
3489
* @param {Object} [options]
3488
3490
* @param {Boolean} [options.ordered=true] If true, execute writes in order and stop at the first error. If false, execute writes in parallel and continue until all writes have either succeeded or errored.
3491
+
* @param {Boolean} [options.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to any operations. Can be overridden at the operation-level.
3489
3492
* @param {ClientSession} [options.session=null] The session associated with this bulk write. See [transactions docs](https://mongoosejs.com/docs/transactions.html).
3490
3493
* @param {String|number} [options.w=1] The [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/). See [`Query#w()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.w()) for more information.
3491
3494
* @param {number} [options.wtimeout=null] The [write concern timeout](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout).
0 commit comments