Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-30606

ARRAY_INSERT is not working as expected.

    XMLWordPrintable

Details

    • Untriaged
    • No
    • CX Sprint 113

    Description

      Sample Doc:

      {
        "mutated": 0,
        "test_rate": 11.11,
        "join_mo": 11,
        "join_day": 21,
        "skills": [
          "skill2010",
          "skill2011"
        ],
        "hikes": [
          20,
          10,
          15
        ],
        "permanent": 1,
        "tasks_points": {
          "task1": 1,
          "task2": 1
        },
        "join_yr": 2010,
        "name": "employee-21",
        "_id": "query-testemployee58360.6484454-0",
        "job_title": "Support",
        "VMs": [
          {
            "name": "vm_11",
            "memory": 11,
            "os": "ubuntu",
            "RAM": 11
          },
          {
            "name": "vm_12",
            "memory": 11,
            "os": "windows",
            "RAM": 11
          }
        ],
        "email": "21-mail@couchbase.com"
      }
      

      N1QL Query: SELECT array_insert(skills, 1, 'skill-20','skill-21') FROM default limit 1
      N1QL Result:

      [
        {
          "$1": [
            "skill2010",
            "skill-20",
            "skill-21",
            "skill2011"
          ]
        }
      ]
      

      CBAS Query: SELECT array_insert(skills, 1, 'skill-20','skill-21') FROM default_shadow limit 1
      Results in Internal Error.

      Normal array insert with raw array works fine:
      SELECT array_insert([1], 1, 'skill-20','skill-21') FROM default_shadow limit 1

      Attachments

        Issue Links

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

          Activity

            People

              ritesh.agarwal Ritesh Agarwal
              ritesh.agarwal Ritesh Agarwal
              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