summaryrefslogtreecommitdiff
path: root/jstests/core/stages_limit_skip.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/stages_limit_skip.js')
-rw-r--r--jstests/core/stages_limit_skip.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/jstests/core/stages_limit_skip.js b/jstests/core/stages_limit_skip.js
index 7ca7b89b180..c582cb6b1e4 100644
--- a/jstests/core/stages_limit_skip.js
+++ b/jstests/core/stages_limit_skip.js
@@ -12,11 +12,20 @@ t.ensureIndex({foo: 1});
// foo <= 20, decreasing
// Limit of 5 results.
-ixscan1 = {ixscan: {args:{keyPattern:{foo: 1},
- startKey: {"": 20},
- endKey: {}, endKeyInclusive: true,
- direction: -1}}};
-limit1 = {limit: {args: {node: ixscan1, num: 5}}};
+ixscan1 = {
+ ixscan: {
+ args: {
+ keyPattern: {foo: 1},
+ startKey: {"": 20},
+ endKey: {},
+ endKeyInclusive: true,
+ direction: -1
+ }
+ }
+};
+limit1 = {
+ limit: {args: {node: ixscan1, num: 5}}
+};
res = db.runCommand({stageDebug: {collection: collname, plan: limit1}});
assert.eq(res.ok, 1);
assert.eq(res.results.length, 5);
@@ -25,7 +34,9 @@ assert.eq(res.results[4].foo, 16);
// foo <= 20, decreasing
// Skip 5 results.
-skip1 = {skip: {args: {node: ixscan1, num: 5}}};
+skip1 = {
+ skip: {args: {node: ixscan1, num: 5}}
+};
res = db.runCommand({stageDebug: {collection: collname, plan: skip1}});
assert.eq(res.ok, 1);
assert.eq(res.results.length, 16);