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

Can append to nested array sub-properties, but we can't simply PATCH a sub-property value #51

Open
boutell opened this issue Jun 1, 2020 · 1 comment

Comments

@boutell
Copy link
Contributor

boutell commented Jun 1, 2020

Currently this works:

{
  $push: {
    'body.items.0.addresses': {
      street: '500 Somewhere Lane'
    }
  }
}

But there is no way to just update the value of a subproperty, such as a string property, i.e. this does not yet work:

{
  'body.items.0.addresses.0.street': '501 Somewhere Lane'
}

This isn't specific to updating properties within arrays, it's not supported at all except for updating a top level property as a whole.

A solution to this will appear in A3 work in progress soon, so hopefully can be borrowed here as well.

@boutell
Copy link
Contributor Author

boutell commented Jun 1, 2020

Actually it looks like dot notation probably doesn't really work for the special operators yet either. As written I think it would cause the loss of other properties higher up in the object. Messy.

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

No branches or pull requests

1 participant