Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #mongoose
ADD COMMENT
Topic
Name
4+3 =