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

Add ARRAY_REPLACE_EQUIVALENT function.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • Morpheus
    • Morpheus
    • query
    • None
    • 1

    Description

      Add new function ARRAY_REPLACE_EQUIVALENT which is the same as ARRAY_REPLACE but tests candidate array values for equivalence rather than equality.  This distinction permits the replacement of NULL values and composite object values with NULL attributes.

       

      An example of the difference:

      SELECT ARRAY_REPLACE([{"a":1},{"a":null}],{"a":null},{"a":2}), ARRAY_REPLACE_EQUIVALENT([{"a":1},{"a":null}],{"a":null},{"a":2});
      ...
          "results": [
          {
              "$1": [
                  {
                      "a": 1
                  },
                  {
                      "a": null
                  }
              ],
              "$2": [
                  {
                      "a": 1
                  },
                  {
                      "a": 2
                  }
              ]
          }
          ],
      ...

      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