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

Json documents with an attribute starting with _ gets stored as type base64

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 2.0
    • 2.0
    • ns_server
    • Security Level: Public
    • None
    • build #1530 on 64 bit ubuntu

    Description

      Json documents with an attribute starting with _ gets stored as type base64

      A json document without any _ attribute gets stored with type "json":
      bash> curl -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@10.3.121.99:8091/couchBase/default/doc1' -d '

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

      '

      {"ok":true,"id":"doc1"}

      bash> curl -i -X GET 'http://Administrator:password@10.3.121.99:8091/couchBase/default/doc1'
      HTTP/1.1 200 OK
      X-Couchbase-Meta:

      {"id":"doc1","rev":"1-00000000000000000000000000000000","expiration":0,"flags":0,"type":"json"}

      Server: MochiWeb/1.0 (Any of you quaids got a smint?)
      Date: Thu, 02 Aug 2012 17:53:27 GMT
      Content-Type: application/json
      Content-Length: 24
      Cache-Control: must-revalidate

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

      A json document with an _ attribute gets stored with type "base64"
      bash> curl -X PUT -H 'Content-Type: application/json' 'http://Administrator:password@10.3.121.99:8091/couchBase/default/doc2' -d '

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

      '

      {"ok":true,"id":"doc2"}

      bash> curl -i -X GET 'http://Administrator:password@10.3.121.99:8091/couchBase/default/doc2'
      HTTP/1.1 200 OK
      X-Couchbase-Meta:

      {"id":"doc2","rev":"1-00000000000000000000000000000000","att_reason":"invalid_key","expiration":0,"flags":0,"type":"base64"}

      Server: MochiWeb/1.0 (Any of you quaids got a smint?)
      Date: Thu, 02 Aug 2012 17:53:46 GMT
      Content-Type: application/json
      Content-Length: 50
      Cache-Control: must-revalidate

      "eyJuYW1lIjoiY291Y2giLCJhZ2UiOjUsIl9uZXciOiIxIn0="

      Diagnostics are attached.

      Attachments

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

        Activity

          People

            damien damien (Inactive)
            deepkaran.salooja Deepkaran Salooja
            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