Reputation: 470
Lets say I have a document structured like that :
datas: {
foo: {
...
keytoupdate: [...]
},
whatever: {
...
keytoupdate: [...]
},
anystring: {
...
keytoupdate: [...]
},
...: {
...
keytoupdate: [...]
}
}
I know that :
I want to update each "keytoupdate" fields, no matter how many of them there are.
The question is: How can I do that ? Is there any magic operator like $ that does the same job for Array ?
Thank you !
Upvotes: 4
Views: 873
Reputation: 470
I'll answer my own question : there is no way to do that, we can't play with dynamic keys, just forget about it ! But there are 2 workarounds :
Upvotes: 2