How does nodeJS add a timestamp when mongodb inserts data?

  node.js, question
var data = {
 _id: reqId,
 userId: userId,
 time_begin: time_begin,
 time_end: time_end,
 Time_save: ** timestamp * *
 Db.collection('sche_ _' plus userid). insertone (data). then (function (r) {
 test.equal(1, r.insertedCount);
 Log ('success');

See this, but don’t know how to do it at all. pray for the great god.

Timestamps are obtained in the program, not generated in the database. Due to network delay and other reasons, the time for database generation may be later than the time saved at the user interface point. In this case, the saved data is wrong. It is very simple to generate the save time in the program.