-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
It's not possible to udpate a sub-document that does not exist like this.
{
"id": "foo"
}Table.update({id: 'foo'}, {$set: {'foo.bar': 'baz'}}).exec();It has to be done like this
Table.update({id: 'foo'}, {$set: {foo: {bar: 'baz'}}}).exec();But this might override other properties inside the foo object.
{
"id": "foo",
"foo": {
"bar": "bar",
"baz": "baz"
}
}Table.update({id: 'foo'}, {$set: {foo: {bar: 'baz'}}}).exec();will result in
{
"id": "foo",
"foo": {
"bar": "baz"
}
}