diff options
author | Drew Paroski <drew.paroski@mongodb.com> | 2023-04-18 03:26:55 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-26 03:09:57 +0000 |
commit | b3b06e3d80944b177dbde83e1f30c785764c4e3d (patch) | |
tree | 1feb7b078df13226a3659947aca704e3268df689 /jstests/aggregation/bugs | |
parent | cd29dad92501a77a4f5d36a63dfbbd66e4299ee9 (diff) | |
download | mongo-b3b06e3d80944b177dbde83e1f30c785764c4e3d.tar.gz |
SERVER-76510 Make makeBsonObj() preserve field order
Diffstat (limited to 'jstests/aggregation/bugs')
-rw-r--r-- | jstests/aggregation/bugs/exclusion_projection_does_not_affect_field_order.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/aggregation/bugs/exclusion_projection_does_not_affect_field_order.js b/jstests/aggregation/bugs/exclusion_projection_does_not_affect_field_order.js index 09d2239389a..135b33e794f 100644 --- a/jstests/aggregation/bugs/exclusion_projection_does_not_affect_field_order.js +++ b/jstests/aggregation/bugs/exclusion_projection_does_not_affect_field_order.js @@ -33,4 +33,9 @@ assert.eq( {$sort: {_id: 1}} ]) .toArray()); + +assert.commandWorked(coll.insert({_id: 4, c: {y: 11, z: 22, a: 33}, a: 1})); + +assert.eq([{_id: 1}, {_id: 2, c: 1}, {_id: 3, y: 1, z: 1}, {_id: 4, c: {y: 11, a: 33}, a: 1}], + coll.aggregate([{$project: {"c.z": 0}}, {$sort: {_id: 1}}]).toArray()); }()); |