diff --git a/lib/datastore.js b/lib/datastore.js index 4b978ad3..8c50a073 100755 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -619,7 +619,10 @@ Datastore.prototype._update = function (query, updateQuery, options, cb) { modifiedDoc = model.modify(candidates[i], updateQuery); if (self.timestampData) { modifiedDoc.createdAt = createdAt; - modifiedDoc.updatedAt = new Date(); + // If no updatedAt date is present, using the current time + if (updateQuery.$set.updatedAt === undefined) { + modifiedDoc.updatedAt = new Date(); + } } modifications.push({ oldDoc: candidates[i], newDoc: modifiedDoc }); }