这是架构:
var pollSchema = new mongoose.Schema({
title: String,
options: [{option: String, votes: Number}]
});
每次点击提交按钮时,我都会尝试查找并增加一个投票。
Poll.findByIdAndUpdate(req.params.id,
{ "$inc": { "options.req.body.option.votes": this.req.body.option.votes + 1 } }
怎么做?