drudge / mongoose-timestamp

Adds createdAt and updatedAt date attributes that get auto-assigned to the most recent create/update timestamp
Other
308 stars 64 forks source link

Does not work with findOneAndUpdate and upsert #17

Closed leecrossley closed 10 years ago

leecrossley commented 10 years ago

No created or lastUpdated properties are populated

fontanon commented 10 years ago

I confirm this issue

drudge commented 10 years ago

Duplicate of #13. This is not currently supported by Mongoose. See https://github.com/drudge/mongoose-timestamp/issues/13#issuecomment-45144198

gonenduk commented 9 years ago

It is supported now with mongoose 4 (and mongodb 3). You can add a middleware to catch pre & post to queries as well. I opened a new issues about it. Didn't check duplicates before :(