We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
createdAt
1 parent a738440 commit 4cfc4d6Copy full SHA for 4cfc4d6
lib/helpers/timestamps/setupTimestamps.js
@@ -51,7 +51,7 @@ module.exports = function setupTimestamps(schema, timestamps) {
51
(this.ownerDocument ? this.ownerDocument() : this).constructor.base.now();
52
const auto_id = this._id && this._id.auto;
53
54
- if (!skipCreatedAt && createdAt && !this.get(createdAt) && this.$__isSelected(createdAt)) {
+ if (!skipCreatedAt && this.isNew && createdAt && !this.get(createdAt) && this.$__isSelected(createdAt)) {
55
this.$set(createdAt, auto_id ? this._id.getTimestamp() : defaultTimestamp);
56
}
57
0 commit comments