how to increment in mongoose code example
Example: inc a value mongoose
Models.post.Post.findOneAndUpdate({ _id: res._id }, { $inc: { views: 1 } }, {new: true },function(err, response) { if (err) { callback(err);} else { callback(response);}
Models.post.Post.findOneAndUpdate({ _id: res._id }, { $inc: { views: 1 } }, {new: true },function(err, response) { if (err) { callback(err);} else { callback(response);}