Start a new topic

Combine contains query with grouping

I am using AngularJS:

I want to combine a contains query with grouping. Seperately, everything works, however, the following doesnt (no results):



var query = new $kinvey.Query();

query.contains('field', fieldsArray);

var group = $kinvey.Group.count('field');

group.query(query);

$kinvey.DataStore.group('collection', group).then(function(res) {

console.log(res);

});



As I said, the following DOES work (desired result):



var query = new $kinvey.Query();

query.contains('field', fieldsArray);

$kinvey.DataStore.find('collection', query).then(function(res) {

console.log(res);

});



The grouping alone works as well.



Any ideas?

Can you paste the output of `JSON.stringify(group)` here so I can try and reproduce?
It's values. And as I said, it DOES work without grouping. Only together they dont.
What data is in the `fieldsArray`? Just values, or ids of some kind?
Login or Signup to post a comment