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)

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      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

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

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            mnunberg Mark Nunberg
            Reporter:
            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