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

updatedAt not updated after findByIdAnd #26

Closed gonenduk closed 8 years ago

gonenduk commented 9 years ago

Only works after save(). Was a mongoose limitation. Solved in mongoose 4. Please add support.

michaek commented 8 years ago

It does seem worthwhile to add middleware support for the mongoose update and findOneAndUpdate functions. http://mongoosejs.com/docs/middleware.html The open pull request #27 seems to address this, and it looks like the one failing test suite execution in CI could be spurious.

michaek commented 8 years ago

And in PR #28, @rfink takes the changes from #27 and leaves a working fork that you can investigate: https://github.com/rfink/mongoose-timestamp/tree/mongoose-4.0

drudge commented 8 years ago

Merged #27 and published to npm as 0.5.0