Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Done
-
2.6.8
-
None
-
Fully Compatible
-
ALL
-
Description
In sharded cluster aggregation by _id alone results in duplicate records in case of orphan records exists on the other shards.
If the record with _id = 1 exists on the shard A (active) and shard B (orphan), the following aggregate will return 2 records.
db.test.aggregate([{$match: {_id: 1} }])
|
It just happens that this is the suggested way of getting an accurate (along with $group stage) count in sharded cluster in the documentation.
The incorrect behaviour is not noticed in 2.4.x and 3.0.0-rc11.