I have a mongo field like this:
answers = [
{
"answer" : "Test",
"votes" : 1
},
{
"answer" : "Blaat",
"votes" : 0
},
{
"answer" : "Bliep",
"votes" : 0
}
]
Now I want to set all "votes" fields to 0, how can I achieve this? I've tried this:
$set: { 'answers.votes': 0 }
It doesn't give an error, but doesn't change the fields.
Any ideas?
Thanks!