Range query with CouchbaseViewQuery::from

Hi everyone, I am looking for the way to perform range query with CouchbaseViewQuery::from. All I found on google seem like they are older version of php sdk. Pls help me.
Thanks guys.

Hey,

Please take a look here for the API: http://docs.couchbase.com/sdk-api/couchbase-node-client-2.0.2/classes/CouchbaseViewQuery.html, you can see the ‘range’ method available there.

Cheers, Brett

1 Like

thank you very much, I follow that link and got a lot of useful method :smiley:

Hi sir, i have another question, When i use CouchbaseViewQuery::from(), it only show 18269 documents, not more, but in my bucket, the number of documents very larger than it. How to prevent this limitation, thank you :smiley:

Hey ita1102,

I suspect that you’re map-reduce is not allowing all the documents to pass through for various reasons. There is no artificial limit placed on the number of items that can exist in a view. However if one of the documents fails to parse as valid JSON, and your emitting something from that document, then it may not be indexed (for instance).

Cheers, Brett

1 Like

Solved: That was development view, after publish it, I can use on full dataset

Hey ita1102,

I will be adding a way to work around this to the ViewQuery API in the next release. For now feel free to use .custom({full_set: 'true'}) on your ViewQuery object to get all results on a development view. You can track this issue here: https://www.couchbase.com/issues/browse/JSCBC-165.

Cheers, Brett