[JCBC-165] ComplexKey does not support partial compound keys with single field Created: 04/Dec/12  Updated: 06/Dec/12  Resolved: 06/Dec/12

Status: Resolved
Project: Couchbase Java Client
Component/s: Documentation
Affects Version/s: 1.1-beta
Fix Version/s: 1.1.0
Security Level: Public

Type: Bug Priority: Critical
Reporter: Chris Tashjian Assignee: Michael Nitschinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
I can't figure out how to do partial compound keys with a single value --

ex. 1 - Specifying both parts of the key:
http://localhost:8092/bucketname/_design/mydesigndoc/_view/myview?group_level=1&startkey=["0",1351742400000]&endkey=["Z",1353073898844]

ex. 2 - Only specifying the first part of the key:
http://localhost:8092/bucketname/_design/mydesigndoc/_view/myview?group_level=1&startkey=["0"]&endkey=["Z"]

I can get ex. 1 to work via the Java client library, but I've had no luck with ex. 2. I've tried setting ranges, complex keys and regular keys. The closest I get is a query string where the "[" and "]" have been escaped which results in a bad URL. I was only able to get this far by manually concatenating the "[" and "]" onto my key and using the query.setKey(String) method.

I believe that ComplexKey should be able to handle ex 2 by calling ComplexKey.of("0") and ComplexKey.of("Z").

 Comments   
Comment by Michael Nitschinger [ 04/Dec/12 ]
Correct, I came across it today as well.
Comment by Michael Nitschinger [ 05/Dec/12 ]
http://review.couchbase.org/#/c/23086/
Comment by Michael Nitschinger [ 06/Dec/12 ]
you can now use the forceArray method on the ComplexKey to do this! .. will be available in 1.1.0.
Generated at Tue Sep 16 11:47:45 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.