diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2018-11-30 11:14:16 -0500 |
---|---|---|
committer | Henrik Edin <henrik.edin@mongodb.com> | 2018-12-20 09:18:05 -0500 |
commit | 6b641e86656df78e9f7ad2f364dec35e19df332e (patch) | |
tree | db8f5ae4deb29e82d63b6f653eb7632d2b66b22b /jstests/aggregation/sources | |
parent | fc1aa5592b8783dc802668659ec87826d789dd2f (diff) | |
download | mongo-6b641e86656df78e9f7ad2f364dec35e19df332e.tar.gz |
SERVER-38249 Implement stdx unordered_map and unordered_set as absl node hash map/set.
Remove stdx::unordered_multimap and multiset.
Custom hashers to stdx::unordered_map are not trusted by default, we
will rehash the produced hash with absl again to ensure we have a good
hash function.
Diffstat (limited to 'jstests/aggregation/sources')
-rw-r--r-- | jstests/aggregation/sources/facet/inner_graphlookup.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/jstests/aggregation/sources/facet/inner_graphlookup.js b/jstests/aggregation/sources/facet/inner_graphlookup.js index 870bb975a8a..340853f7721 100644 --- a/jstests/aggregation/sources/facet/inner_graphlookup.js +++ b/jstests/aggregation/sources/facet/inner_graphlookup.js @@ -30,14 +30,21 @@ as: "connected" } }; - const normalResults = graphColl.aggregate([graphLookupStage]).toArray(); - const facetedResults = graphColl.aggregate([{$facet: {nested: [graphLookupStage]}}]).toArray(); + + const projectStage = {$project: {_id: 1, edges: 1, connected_length: {$size: "$connected"}}}; + + const normalResults = graphColl.aggregate([graphLookupStage, projectStage]).toArray(); + const facetedResults = + graphColl.aggregate([{$facet: {nested: [graphLookupStage, projectStage]}}]).toArray(); assert.eq(facetedResults, [{nested: normalResults}]); + const sortStage = {$sort: {_id: 1, "connected._id": 1}}; + const normalResultsUnwound = - graphColl.aggregate([graphLookupStage, {$unwind: "$connected"}]).toArray(); + graphColl.aggregate([graphLookupStage, {$unwind: "$connected"}, sortStage]).toArray(); const facetedResultsUnwound = - graphColl.aggregate([{$facet: {nested: [graphLookupStage, {$unwind: "$connected"}]}}]) + graphColl + .aggregate([{$facet: {nested: [graphLookupStage, {$unwind: "$connected"}, sortStage]}}]) .toArray(); assert.eq(facetedResultsUnwound, [{nested: normalResultsUnwound}]); }()); |