Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-6544 Collection Operators Enhancements
  3. DOC-5079

docs for N1QL operator ARRAY should include indexed example

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • Major
    • None
    • Mad Hatter
    • query
    • DOC-2022-S14, DOC-2022-S15
    • 1

    Description

      The ARRAY operator for N1QL is documented here:

      https://docs.couchbase.com/server/6.0/n1ql/n1ql-language-reference/collectionops.html#array

      This operator has a two-parameter form, where the first index is not the array value, but rather its index. This usage should be demonstrated:

      select array v for i:v in ["a", "b", "c", "d"] when i < 2 end
      

      returnsĀ 

      [
        {
          "$1": [
            "a",
            "b"
          ]
        }
      ]
      

      Attachments

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

        Activity

          People

            simon.dew Simon Dew
            johan.larson Johan Larson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty