diff options
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index 55d85e07..ee53c7ab 100644 --- a/models/users.js +++ b/models/users.js @@ -54,6 +54,8 @@ Users.attachSchema( autoValue() { if (this.isInsert) { return new Date(); + } else if (this.isUpsert) { + return { $setOnInsert: new Date() }; } else { this.unset(); } |