Description
If you use the range() method with 0 or 1 parameters, then the startkey and endkey are set to empty strings (https://github.com/couchbaselabs/php-couchbase/blob/master/stub/CouchbaseViewQuery.class.php#L242):
public function range($start = NULL, $end = NULL, $inclusive_end = false) {
if ($start !== NULL)
else
{ $this->options['startkey'] = ''; }if ($end !== NULL)
{ $this->options['endkey'] = str_replace('\\\\', '\\', json_encode($end)); }else
{ $this->options['endkey'] = ''; } $this->options['inclusive_end'] = $inclusive_end ? 'true' : 'false';
return $this;
}
This causes the following error:
{"error":"bad_request","reason":"invalid UTF-8 JSON: {{error,insufficient_data},[]}"}
To avoid this the two options should be unset rather than set to an empty string.