A problem of operating the data queried by mongooser R.

  node.js, question

This is the kind of data returned.
This object does not seem to be a corresponding document in the database but a model, and the internal attribute of _doc of this object is. But I can get the value directly from above

 // 1474732800000

But assigning a value to a document is not enough

 date: {$gte: firstDayOfMonth}
 date: 1
 .then(dates => {
 dates.map(x => {
 x.date = moment(x.date).format('YYYY-MM-DD HH:mm:ss');
 // { _id: 57c5a02c8890a02814771e0d, date: 1477670400000, __v: 0 }

The x._doc.date assignment for the model must be valid. I would like to know why and how to correct the data in the original document.

Try, dates = dates.toObject (); Then assign a value