summaryrefslogtreecommitdiff
path: root/jstests/readonly/aggregate.js
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2016-02-26 16:33:23 -0500
committerAdam Midvidy <amidvidy@gmail.com>2016-03-10 11:03:15 -0500
commit6efa681435ec30467ca88edc449b241bb2c326bf (patch)
tree41f788b7cb9f2058247266f0f51f3b7947fa267b /jstests/readonly/aggregate.js
parent947307dbf80d59313e8c154eea1612fedb01a321 (diff)
downloadmongo-6efa681435ec30467ca88edc449b241bb2c326bf.tar.gz
SERVER-22356 add read_only_sharded suite
Diffstat (limited to 'jstests/readonly/aggregate.js')
-rw-r--r--jstests/readonly/aggregate.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/jstests/readonly/aggregate.js b/jstests/readonly/aggregate.js
index 9f74f739c4d..aba6a7aa3a3 100644
--- a/jstests/readonly/aggregate.js
+++ b/jstests/readonly/aggregate.js
@@ -69,13 +69,17 @@ runReadOnlyTest(function() {
// Find titles nominated for the most awards.
var mostAwardsPipeline = [
{$unwind: "$nominations"},
- {$group: {_id: "$nominations.title", count: {$sum: 1}}},
- {$sort: {count: -1}},
- {$limit: 2}
+ {$group: {
+ _id: "$nominations.title",
+ count: {$sum: 1}}},
+ {$sort: {count: -1, _id: 1}},
+ {$limit: 2},
];
- assert.docEq(readableCollection.aggregate(mostAwardsPipeline).toArray(),
- [{_id: "The Revenant", count: 3}, {_id: "Spotlight", count: 3}]);
+ assert.docEq(readableCollection.aggregate(mostAwardsPipeline).toArray(), [
+ {_id: "Spotlight", count: 3},
+ {_id: "The Revenant", count: 3}
+ ]);
// Check that pipelines fail with allowDiskUse true. We use runCommand manually because
// the helper has conflicting error handling logic.