PHPLIB-417: countDocuments should use group with _id: 1

parent 9a7e242d
......@@ -192,7 +192,7 @@ class CountDocuments implements Executable
$pipeline[] = ['$limit' => $this->options['limit']];
}
$pipeline[] = ['$group' => ['_id' => null, 'n' => ['$sum' => 1]]];
$pipeline[] = ['$group' => ['_id' => 1, 'n' => ['$sum' => 1]]];
$cmd = [
'aggregate' => $this->collectionName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment