次のコードがあります。
var conditions = {_id: playerID, 'gameStats.GameID' : gameID},
update = {$inc: {'gameStats.$.wins' : 1}},
options = {new : true};
player.findAndModify(conditions, update, options, function (err, doc) {
if (err) {
console.log("updated failed")
return res.sendStatus(300);
}
実行すると「TypeError: undefined is not a function」というエラーメッセージが返され、何が問題なのか本当にわかりません。誰か助けてくれませんか?