summaryrefslogtreecommitdiffstats
path: root/models/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/rules.js')
-rw-r--r--models/rules.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/rules.js b/models/rules.js
index 202071fc..2e6729cc 100644
--- a/models/rules.js
+++ b/models/rules.js
@@ -27,6 +27,8 @@ Rules.attachSchema(
autoValue() {
if (this.isInsert) {
return new Date();
+ } else if (this.isUpsert) {
+ return { $setOnInsert: new Date() };
} else {
this.unset();
}