Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update with dot properties #41

Open
SamVerschueren opened this issue Mar 30, 2016 · 1 comment
Open

update with dot properties #41

SamVerschueren opened this issue Mar 30, 2016 · 1 comment
Labels

Comments

@SamVerschueren
Copy link
Owner

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"
    }
}
@SamVerschueren
Copy link
Owner Author

I think it should be possible to do this with the if_not_exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant