-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 5.0.9, 6.0.0-rc10
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
v6.0, v5.0
-
QO 2022-07-11, QO 2022-07-25, QO 2022-08-08, QO 2022-08-22, QO 2022-09-05, QO 2022-09-19, QO 2022-10-03, QO 2022-10-17, QO 2022-10-31
It seems after sorting a cursor that is querying a sharded collection, the documents that the cursor returns are missing $-prefixed fields. Repro of the bug, provided by max.hirschhorn@mongodb.com:
(function() { "use strict"; const document = ({_id: 5, $set: {$inc: {x: 5}}}); assert.commandWorked(db.mycoll.insert(document)); assert.eq([document], db.mycoll.find().hint({$natural: 1}).toArray()); assert.eq([document], db.mycoll.find().hint({_id: 1}).toArray()); assert.eq([document], db.mycoll.find().sort({_id: 1}).toArray()); })();
will fail on the sort() call if run in the sharded_collections_jscore_passthrough suite.
This bug happens on 5.0, 6.0, and master. We should also investigate if this applies to dot prefixed fields as well.
- related to
-
SERVER-71643 Complete TODO listed in SERVER-67406
- Closed