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

When storing a document with a property starting with an underscore, the document is stored as an attachment.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.0-beta
    • Fix Version/s: 2.0
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Windows 7, Couchbase Server 2.0 build 1733

      Description

      As I understand it, with the introduction of the meta object, underscore fields are no longer special nor protected. To reproduce, create a new doc with the JSON below either with an SDK or the web console.

      { "_foo" : "newDoc", "click": "to edit", "new in 2.0": "there are no reserved field names" }
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        john John Zablocki (Inactive) added a comment -

        Not sure who should get this or what sub-component is affected, so sending your way for review...

        Show
        john John Zablocki (Inactive) added a comment - Not sure who should get this or what sub-component is affected, so sending your way for review...
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        Deep can you reproduce and assign it to ep-engine with more logs

        Show
        farshid Farshid Ghods (Inactive) added a comment - Deep can you reproduce and assign it to ep-engine with more logs
        Hide
        mikew Mike Wiederhold added a comment -

        I have verified that this is an issue. Please see the screenshots I have uploaded.

        Show
        mikew Mike Wiederhold added a comment - I have verified that this is an issue. Please see the screenshots I have uploaded.
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        Without underscore:

        bash> curl -v -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@127.0.0.1:9500/default/doc1' -d '

        { "name" : "couch", "age" : 5}

        '

        • About to connect() to 127.0.0.1 port 9500 (#0) {"ok":true,"id":"doc1"}
        • Connection #0 to host 127.0.0.1 left intact
        • Closing connection #0

        bash> curl -v -X GET 'http://Administrator:password@127.0.0.1:9500/default/doc1'

        • About to connect() to 127.0.0.1 port 9500 (#0)
          < X-Couchbase-Meta: {"id":"doc1","rev":"1-00000000000000000000000000000000","expiration":0,"flags":0,"type":"json"} {"name":"couch","age":5}

        With underscore:

        bash> curl -v -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@127.0.0.1:9500/default/doc1' -d '

        { "_name" : "couch", "age" : 5}

        '

        • About to connect() to 127.0.0.1 port 9500 (#0) {"ok":true,"id":"doc1"}
        • Connection #0 to host 127.0.0.1 left intact
        • Closing connection #0

        bash> curl -v -X GET 'http://Administrator:password@127.0.0.1:9500/default/doc1'

        • About to connect() to 127.0.0.1 port 9500 (#0)
          < X-Couchbase-Meta: {"id":"doc1","rev":"1-00000000000000000000000000000000","att_reason":"invalid_key","expiration":0,"flags":0,"type":"base64"}

          "eyJfbmFtZSI6ImNvdWNoIiwiYWdlIjo1fQ=="

        Show
        farshid Farshid Ghods (Inactive) added a comment - Without underscore: bash> curl -v -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@127.0.0.1:9500/default/doc1' -d ' { "name" : "couch", "age" : 5} ' About to connect() to 127.0.0.1 port 9500 (#0) {"ok":true,"id":"doc1"} Connection #0 to host 127.0.0.1 left intact Closing connection #0 bash> curl -v -X GET 'http://Administrator:password@127.0.0.1:9500/default/doc1' About to connect() to 127.0.0.1 port 9500 (#0) < X-Couchbase-Meta: {"id":"doc1","rev":"1-00000000000000000000000000000000","expiration":0,"flags":0,"type":"json"} {"name":"couch","age":5} With underscore: bash> curl -v -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@127.0.0.1:9500/default/doc1' -d ' { "_name" : "couch", "age" : 5} ' About to connect() to 127.0.0.1 port 9500 (#0) {"ok":true,"id":"doc1"} Connection #0 to host 127.0.0.1 left intact Closing connection #0 bash> curl -v -X GET 'http://Administrator:password@127.0.0.1:9500/default/doc1' About to connect() to 127.0.0.1 port 9500 (#0) < X-Couchbase-Meta: {"id":"doc1","rev":"1-00000000000000000000000000000000","att_reason":"invalid_key","expiration":0,"flags":0,"type":"base64"} "eyJfbmFtZSI6ImNvdWNoIiwiYWdlIjo1fQ=="
        Hide
        peter peter added a comment -

        Aaron, can you take a look at this?

        Show
        peter peter added a comment - Aaron, can you take a look at this?
        Hide
        aaron Aaron Miller (Inactive) added a comment - - edited

        This is a duplicate of MB-6773, which I have a patch for: http://review.couchbase.com/#/c/21324/

        Show
        aaron Aaron Miller (Inactive) added a comment - - edited This is a duplicate of MB-6773 , which I have a patch for: http://review.couchbase.com/#/c/21324/
        Hide
        aaron Aaron Miller (Inactive) added a comment -

        Duplicate of MB-6773

        Show
        aaron Aaron Miller (Inactive) added a comment - Duplicate of MB-6773
        Hide
        maria Maria McDuff (Inactive) added a comment -

        Dupe.

        Show
        maria Maria McDuff (Inactive) added a comment - Dupe.

          People

          • Assignee:
            aaron Aaron Miller (Inactive)
            Reporter:
            john John Zablocki (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes