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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -