Use the dot notation to refer to the embedded field in the projection document and set to 0 . Starting in MongoDB 4.4, you can also specify embedded fields using the nested form, e.g. { size: { uom: 0 } } .
$ is referred to the root document fields where as $$ referred to the variable names. Here '$data' is the document array field and the $$currentData is the variable taken in the as expression of $map aggregation.
for(var key in resp.updated_items){
Meteor.users.update({backend_id: Meteor.user().backend_id},
{$set: {'profile': {key: resp.updated_items[key]}}});
}
And this query set proper information to key key. But how can I assign 'real' value of key?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With