[PCBC-168] cannot query with compound key Created: 17/Dec/12  Updated: 18/Dec/12  Resolved: 18/Dec/12

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.1
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Matt Ingenthron Assignee: Mark Nunberg
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File oleg.php    

 Description   
A view has been created and it's being queried properly, but the compound keys seem to be getting quoted.

Is there a workaround for this approach? Is something like the ComplexKey class used in Java needed here in PHP?

A basic investigation shows:
GET /default/_design/debug/_view/user2hour?startkey=%22%5C%22%5Buser_event%5D%5C%22%22&endkey=%22%5C%22%5Buser_event__%5D%5C%22%22&group=true << doesn't work
GET /default/_design/debug/_view/user2hour?startkey=%5B%22user_event%22%5D&endkey=%5B%22user_event__%22%5D&group=true HTTP/1.1 << works

So it seems it's extra quoting that's going on.

See also:
http://www.couchbase.com/forums/thread/view-array-key-started-behave-differently-http-request-and-php-api

 Comments   
Comment by Matt Ingenthron [ 17/Dec/12 ]
I've assigned this to Michael, since he may have an idea how to approach the problem with a workaround.

Michael, once you have an idea what it is, can you please reassign it to Trond for a proper fix?
Comment by Mark Nunberg [ 18/Dec/12 ]
I've answered this on the forum post.. In summary, nothing is broken, but the API changed between DP versions.

The API change is reversible by using an extra handle-level option (see the forum post)
Comment by Matt Ingenthron [ 18/Dec/12 ]
Mark: thanks so much for helping to address that. I didn't pick up on the change.
Generated at Thu Oct 23 01:38:41 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.