📜  猫鼬增量子文档 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:02.677000             🧑  作者: Mango

代码示例1
BlogPost.update({_id: blogPostId, 'comments._id': commentId}, {$inc:{'comments.$.rating':1}})
    .then((blogPost) => res.status(200).json({
    'status': 'Comment rating is increased.'
}))