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