node.js - How do I update a property with the current date in a Mongoose schema on every save? -
in database collections, want update 'lastchanged' field every time record updated current datetime. want in same format mongoose's default date like:
isodate("2011-10-06t14: 01: 31.106z")
any words of wisdom?
if want iso string use:
new date().toisostring()
Comments
Post a Comment