summaryrefslogtreecommitdiff
path: root/jstests/core/stages_fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/stages_fetch.js')
-rw-r--r--jstests/core/stages_fetch.js36
1 files changed, 26 insertions, 10 deletions
diff --git a/jstests/core/stages_fetch.js b/jstests/core/stages_fetch.js
index 2bff065a5d7..7adc52c67c5 100644
--- a/jstests/core/stages_fetch.js
+++ b/jstests/core/stages_fetch.js
@@ -12,20 +12,36 @@ t.ensureIndex({foo: 1});
// 20 <= foo <= 30
// bar == 25 (not covered, should error.)
-ixscan1 = {ixscan: {args:{keyPattern:{foo:1},
- startKey: {"": 20},
- endKey: {"" : 30}, endKeyInclusive: true,
- direction: 1},
- filter: {bar: 25}}};
+ixscan1 = {
+ ixscan: {
+ args: {
+ keyPattern: {foo: 1},
+ startKey: {"": 20},
+ endKey: {"": 30},
+ endKeyInclusive: true,
+ direction: 1
+ },
+ filter: {bar: 25}
+ }
+};
res = db.runCommand({stageDebug: {collection: collname, plan: ixscan1}});
assert.eq(res.ok, 0);
// Now, add a fetch. We should be able to filter on the non-covered field since we fetched the obj.
-ixscan2 = {ixscan: {args:{keyPattern:{foo:1},
- startKey: {"": 20},
- endKey: {"" : 30}, endKeyInclusive: true,
- direction: 1}}};
-fetch = {fetch: {args: {node: ixscan2}, filter: {bar: 25}}};
+ixscan2 = {
+ ixscan: {
+ args: {
+ keyPattern: {foo: 1},
+ startKey: {"": 20},
+ endKey: {"": 30},
+ endKeyInclusive: true,
+ direction: 1
+ }
+ }
+};
+fetch = {
+ fetch: {args: {node: ixscan2}, filter: {bar: 25}}
+};
res = db.runCommand({stageDebug: {collection: collname, plan: fetch}});
printjson(res);
assert.eq(res.ok, 1);