How do I update a property with the current date in a Mongoose schema on every save?

前端 未结 4 984
南方客
南方客 2021-01-03 23:59

In my database collections, I want to update a \'lastChanged\' field every time the record is updated with the current datetime. I want it to be in the same format as mongoo

4条回答
提交回复
热议问题