Answers for "mongoose increment sub document"

1

mongoose increment sub document

BlogPost.update({_id: blogPostId, 'comments._id': commentId}, {$inc:{'comments.$.rating':1}})
    .then((blogPost) => res.status(200).json({
    'status': 'Comment rating is increased.'
}))
Posted by: Guest on December-01-2020

Code answers related to "mongoose increment sub document"

Code answers related to "Javascript"

Browse Popular Code Answers by Language