We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am getting this error when I try to use group and count.
ERROR:
InvalidArgumentException in Aggregate.php line 93: $pipeline is not a list (unexpected index: "$group")
MongoDB version: 3.2.9 jenssegers/mongodb version : 3.1.0-alpha
Here is my code.
$analytics = DB::collection('analytics')->raw( function ( $collection ) { return $collection->aggregate([ '$group' => [ '_id' => [ 'campaign_id' => '$campaign_id', 'type' => '$type' ], 'count' => ['$sum' => 1], ] ]); });
I've also tried this code (enclosing aggregate in array) following solution form this issue. #880
$analytics = DB::collection('analytics')->raw( function ( $collection ) { return $collection->aggregate([ [ '$group' => [ '_id' => [ 'campaign_id' => '$campaign_id', 'type' => '$type' ], 'count' => ['$sum' => 1], ] ], ]); });
but this time error is
UnexpectedValueException in compiled.php line 16079: The Response content must be a string or object implementing __toString(), "object" given.
The text was updated successfully, but these errors were encountered:
ISSUE FIXED #880 solution worked.
Sorry, something went wrong.
No branches or pull requests
I am getting this error when I try to use group and count.
ERROR:
MongoDB version: 3.2.9
jenssegers/mongodb version : 3.1.0-alpha
Here is my code.
I've also tried this code (enclosing aggregate in array) following solution form this issue. #880
but this time error is
The text was updated successfully, but these errors were encountered: