us,ng function i,n mongoose code example
Example 1: mongoose response to object
MyModel.findOne().lean().exec(function(err, doc) {
doc.addedProperty = 'foobar';
res.json(doc);
});
Example 2: mongoose max record
const maxQuery = Goods.find({}).sort({ price: -1 }).limit(1).then(goods => goods[0].price);