Description
In the section on "OPTIONS" here:
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/insert.html#insert-select
change "Only the expiration attribute has any effect; any other attributes are ignored." to "Only the listed attributes have any effect; any other attributes are ignored."
and after the item "expiration" add:
xattrs
An object containing at the top-level extended attribute names and their valid JSON content. Note: The object does not replace all defined extended attributes and only lists those to be added or updated, and only complete values can be provided; you cannot specify only nested fields to mutate as the complete value is assigned at the top level.
(An example for clarity: supposing there is an existing XATTR called "a" with a value {"b":1}. An UPSERT with options: {"xattr":{"a":{"c":1}} would replace the XATTR "a"'s value with {"c":1}.)
Update the syntax diagrams and explanation here:
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/update.html#set-clause
indicating that in addition to:
SET meta().expiration = expiration
,
SET meta().xattrs.<xattr>[.path] = <value>
is valid syntax too.
Perhaps changing the definition of "meta" to something like:
A META().expiration expression specifying the expiration property of the document being updated or META().xattrs.<xattr> expression specifying the extended attribute (XATTR) of the document being updated. Individual fields in composite XATTR values may be referenced directly via the nested path.
Similarly here:
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/update.html#unset-clause
indicate that:
UNSET meta().xattrs.<xattr>[.path]
is valid syntax.
Attachments
Issue Links
- is caused by
-
MB-63223 Add mutation of xattrs
- Resolved