Using PHP SDK 2.0.4 I am unable to set startkey or endkey.
I tried $query->range(start,end,inclusive_end);
I also tried $query->custom() as per the doc.
I am trying to set both these keys as an array. It works great in the earlier SDK but not in 2.0.
The options variable does work but I have not seen any examples for startkey and endkey.
Couchbase server is 3.0. As I stated using a previous version of the SDK pre 2.0 everything worked great.
---------Here is the view
function (doc,meta) {
emit([doc.messageType,parseInt(doc.lastUpdate)], null);
}
----------Here is a sample of the PHP code:
The options object that exists on the CouchbaseViewQuery is actually intended to be private, it is a bug that it is exposed directly. The options array is used by all the internal functions to build up your query. In your case, you are building the range using ->range, and then by specifying the options array directly you are eradicating the values set by the range function. You should use ->skip, ->limit and ->order in place of specifying the options array directly.
I did as you said and works as advertised.
Guess I shouldn’t have read the source so close. It was a little confusion since there are limited examples.
Thank You Much,
I reposted my solution so this may help someone else.
In regards to this thread. I have tried to implement the key and keys methods for the CouchbaseViewQuery. Should I user Custom or key or keys. The API does not expose methods other than custom,skip,limit,stale.