summaryrefslogtreecommitdiff
path: root/jstests/core/stages_sort.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/stages_sort.js')
-rw-r--r--jstests/core/stages_sort.js32
1 files changed, 21 insertions, 11 deletions
diff --git a/jstests/core/stages_sort.js b/jstests/core/stages_sort.js
index 89b71a28f8b..b6cb5a456af 100644
--- a/jstests/core/stages_sort.js
+++ b/jstests/core/stages_sort.js
@@ -11,13 +11,23 @@ if (false) {
t.ensureIndex({foo: 1});
// Foo <= 20, descending.
- ixscan1 = {ixscan: {args:{name: "stages_sort", keyPattern:{foo: 1},
- startKey: {"": 20},
- endKey: {}, endKeyInclusive: true,
- direction: -1}}};
+ ixscan1 = {
+ ixscan: {
+ args: {
+ name: "stages_sort",
+ keyPattern: {foo: 1},
+ startKey: {"": 20},
+ endKey: {},
+ endKeyInclusive: true,
+ direction: -1
+ }
+ }
+ };
// Sort with foo ascending.
- sort1 = {sort: {args: {node: ixscan1, pattern: {foo: 1}}}};
+ sort1 = {
+ sort: {args: {node: ixscan1, pattern: {foo: 1}}}
+ };
res = db.runCommand({stageDebug: sort1});
assert.eq(res.ok, 1);
assert.eq(res.results.length, 21);
@@ -25,10 +35,10 @@ if (false) {
assert.eq(res.results[20].foo, 20);
// Sort with a limit.
- //sort2 = {sort: {args: {node: ixscan1, pattern: {foo: 1}, limit: 2}}};
- //res = db.runCommand({stageDebug: sort2});
- //assert.eq(res.ok, 1);
- //assert.eq(res.results.length, 2);
- //assert.eq(res.results[0].foo, 0);
- //assert.eq(res.results[1].foo, 1);
+ // sort2 = {sort: {args: {node: ixscan1, pattern: {foo: 1}, limit: 2}}};
+ // res = db.runCommand({stageDebug: sort2});
+ // assert.eq(res.ok, 1);
+ // assert.eq(res.results.length, 2);
+ // assert.eq(res.results[0].foo, 0);
+ // assert.eq(res.results[1].foo, 1);
}