Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-351

Python SDK upsert confusion regarding string vs json

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • None
    • None

    Description

      According to this doc:

      http://pythonhosted.org/couchbase/api/couchbase.html#single-key-data-methods

      the value must be either a bytes or str object encodable as UTF-8.

      So based on that, I tried:

      doc = bucket.upsert("mydoc2", '

      {"foo":"bar"}

      ')

      however when I tried to later fetch that doc, it was not recognized as JSON

      OTOH, if I passed it a dictionary:

      doc = bucket.upsert("mydoc3", json.loads('

      {"foo":"bar"}

      '))

      then it worked, and the doc was recognized as JSON

      Also, I was surprised to find zero examples of storing JSON.. i

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            traun Traun Leyden (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

                PagerDuty