I have a document in a mongodb collection like this :
{
id: String,
username: String,
password: String,
email: String,
user_messeges: [{
mail:String,
messeges:[ {String} ]
}]
}
And i want to update messeges array in user_messeges array.
i used this mathod but i got error: "The positional operator did not find the match needed from the query. Unexpanded update"
User.update({'user_messeges.email':my_email},{$push : {'user_messeges.$.messages':msg}},{upsert:true},function(err)...
How can I do this ?
Thanks for help.
Aucun commentaire:
Enregistrer un commentaire