Can't query by group


#1

Hi,

I get an error when I want to group with this query in PHP:
$qry = CouchbaseViewQuery::from(‘adgroups’, ‘adwords’)->group(true);

When I execute this query it says:
query_parse_error: Query parameter group_level is not compatible with group

I think this is pretty strange, because I only specify that group is true and I don’t specify the group_level. Also, this error came up when I updated Couchbase from version 2.5.1 to version 3.0.1. On version 2.5.1 everything just worked fine.

Does someone have a solution for this error?


#2

Hey Raikonem,

It looks like there may have been a change in the most recent Couchbase Server releases which is affecting this. I am investigating, in the meantime, you should be able to use .custom({group:"true"}) (note the quotes are necessary).

Cheers, Brett


#3

Thanks for your reply!

It looks like your query is working for me with a few changes i’ve made.
$qry = CouchbaseViewQuery::from(‘adgroups’, ‘adwords’)->range($startkey, $endkey, true)->custom([“group_level” => “2”]);