Details
Description
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.
Attachments
Issue Links
- related to
-
DOCS-15440 [C2C] Mongosync will not replicate $-prefixed fields during initial sync for GA
-
- Closed
-
-
SERVER-71643 Complete TODO listed in SERVER-67406
-
- Closed
-