Skip to content

Commit f0d369d

Browse files
committed
PHPLIB-417: countDocuments should use group with _id: 1
1 parent 9a7e242 commit f0d369d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Operation/CountDocuments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function createCommandDocument()
192192
$pipeline[] = ['$limit' => $this->options['limit']];
193193
}
194194

195-
$pipeline[] = ['$group' => ['_id' => null, 'n' => ['$sum' => 1]]];
195+
$pipeline[] = ['$group' => ['_id' => 1, 'n' => ['$sum' => 1]]];
196196

197197
$cmd = [
198198
'aggregate' => $this->collectionName,

0 commit comments

Comments
 (0)