Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-12493

Amend sections indicating XATTR manipulation is possible.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • Morpheus, 7.7
    • Morpheus, 7.7
    • query
    • None
    • 0

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              simon.dew Simon Dew
              Donald.haggart Donald Haggart
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty