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

View API does not work correctly when using a long key (more than 150 chars)

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 1.2.0
    • 1.1.0
    • library
    • Security Level: Public
    • None
    • Tested with :
      SDK 1.1.0 / LibCouchbsae 2.3.1
      Couchbase Server 2.2 and 2.1.1
      All on OS X

    Description

      See http://www.couchbase.com/communities/q-and-a/python-sdk-bug-query-loooong-key

      Create a view that generate an index with a long key, more than 151 chars. For example I have created the following documents:

      {
        "key": "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567899999",
        "name": "tug"
      }
      

      I have created a view that use the key attribute

      function (doc, meta) {
        emit(doc.key);
      }
      

      Using this key in a query does not work:

      #!/usr/bin/env python
      from couchbase import Couchbase
      from couchbase.views.params import UNSPEC, Query
      cb = Couchbase.connect(bucket='default')
      k = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567899999",
       
      rows = cb.query("test", "test",  key=k)
       
      for row in rows:
          print "Key \"%s\". ID '%s'" % (row.key, row.docid)
      

      I have tested in Java and REST and it is working

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            tgrall Tug Grall (Inactive)
            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