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

field of empty string is not able to use as path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • Cheshire-Cat
    • query
    • Untriaged
    • 1
    • Unknown

    Description

      insert into default values ("k001", {"":1});  
       
      select * from default USE KEYS "k001";
      "results": [
          {
              "default": {
                  "": 1
              }
          }
          ]
      select RAW d.`` from default AS d USE KEYS "k001";
       "errors": [
              {
                  "code": 3000,
                  "msg": "syntax error - at `"
              }
          ]
       
       
      Work around in N1QL use  as map syntax
       
      select RAW d.[""] from default AS d USE KEYS "k001";
          "results": [
          {
              "": 1
          }
          ]
      
      

      According to https://www.json.org/json-en.html empty string in field is valid

      https://forums.couchbase.com/t/sub-document-operations-with-empty-key-in-path/19540/4

      Attachments

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

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty