Hey I'm trying to update all subdocuments contained within an array using the following code
setDuelToInactive: (duel) ->
Duels.update({_id: duel._id}, $set: {active: false})
userOneId = duel.userOneId
userTwoId = duel.userTwoId
Users.update({_id: userOneId}, { $set: { 'profile.character.souls.$.active': false} })
Users.update({_id: userTwoId}, { $set: { 'profile.character.souls.$.active': false} })
return
where the souls field in the Users collection is the array. I receive the following error message
MongoError: Cannot apply the positional operator without a corresponding query field containing an array.