How to operate on the data after querying the data

  node.js, question
Blog.find().select(‘title time.day type id’).exec(function(err,data){
 res.render(‘home/index’,{
 blogs: data,
 title:‘Express’
 });
 });

Here, I Query directly foreach the front page after arriving at the data array Data, but he wants to use moment to do a function released before xx, and he doesn’t know how to query the data.

Just process the data before render.

Blog.find().select(‘title time.day type id’).exec(function(err,data){
 //Start processing here
 data.forEach(function(al){
 //al is an element in data. Carry out processing according to your idea. You may need to define variables to store the processed results. Use new variables when rendering!
 })
 //End processing here
 res.render(‘home/index’,{
 blogs: data,
 title:‘Express’
 });
 });