diff --git a/lib/helpers/model/castBulkWrite.js b/lib/helpers/model/castBulkWrite.js index 01e3cdd36c4..1afb36987fa 100644 --- a/lib/helpers/model/castBulkWrite.js +++ b/lib/helpers/model/castBulkWrite.js @@ -70,7 +70,7 @@ module.exports = function castBulkWrite(originalModel, op, options) { _addDiscriminatorToObject(schema, op['updateOne']['filter']); const doInitTimestamps = getTimestampsOpt(op['updateOne'], options); - + if (model.schema.$timestamps != null && doInitTimestamps) { const createdAt = model.schema.$timestamps.createdAt; const updatedAt = model.schema.$timestamps.updatedAt;