You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the UPDATE clause only accepts simple top-level fields foo.
We should be able to update nested fields or array indexes using dot notation.
UPDATE users SETa.3.name = [1, 2, 3];
Because nested values can be tricky, the SET clause must only set a value when it is possible. If we take the example above, the document must respect the following requirements in order to be settable:
a is an array
a.3 exists and is a document
a.3.name may or may not exist (same rules as for top-level fields, see below)
Currently, the rule is: if the field doesn't exist, we create it, otherwise we replace it with the new value.
With this change, the rule still applies but only for the element of the dot notation path that is the most to the right.
When the field using backquotes with spaces like this some "field ", the spaces must be deleted or not?
inputs: ` some "field" ` OR `a.` b ` . c`
outputs :
`some "field" ` OR `a.b.c`
Spaces should be deleted.
Is the expected behaviour?
Currently, the
UPDATE
clause only accepts simple top-level fieldsfoo
.We should be able to update nested fields or array indexes using dot notation.
Because nested values can be tricky, the SET clause must only set a value when it is possible. If we take the example above, the document must respect the following requirements in order to be settable:
a
is an arraya.3
exists and is a documenta.3.name
may or may not exist (same rules as for top-level fields, see below)Currently, the rule is: if the field doesn't exist, we create it, otherwise we replace it with the new value.
With this change, the rule still applies but only for the element of the dot notation path that is the most to the right.
Exception for arrays
This example shows that the above rule must not apply for arrays. If the array index doesn't exist, it must not be created.
The text was updated successfully, but these errors were encountered: