summaryrefslogtreecommitdiff
path: root/jstests/core/stages_and_hash.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/core/stages_and_hash.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/stages_and_hash.js')
-rw-r--r--jstests/core/stages_and_hash.js42
1 files changed, 33 insertions, 9 deletions
diff --git a/jstests/core/stages_and_hash.js b/jstests/core/stages_and_hash.js
index 3bf1bde4951..8dcc8cf1345 100644
--- a/jstests/core/stages_and_hash.js
+++ b/jstests/core/stages_and_hash.js
@@ -13,25 +13,49 @@ t.ensureIndex({bar: 1});
t.ensureIndex({baz: 1});
// Scan foo <= 20
-ixscan1 = {ixscan: {args:{name: "stages_and_hashed", keyPattern:{foo: 1},
- startKey: {"": 20}, endKey: {},
- endKeyInclusive: true, direction: -1}}};
+ixscan1 = {
+ ixscan: {
+ args: {
+ name: "stages_and_hashed",
+ keyPattern: {foo: 1},
+ startKey: {"": 20},
+ endKey: {},
+ endKeyInclusive: true,
+ direction: -1
+ }
+ }
+};
// Scan bar >= 40
-ixscan2 = {ixscan: {args:{name: "stages_and_hashed", keyPattern:{bar: 1},
- startKey: {"": 40}, endKey: {},
- endKeyInclusive: true, direction: 1}}};
+ixscan2 = {
+ ixscan: {
+ args: {
+ name: "stages_and_hashed",
+ keyPattern: {bar: 1},
+ startKey: {"": 40},
+ endKey: {},
+ endKeyInclusive: true,
+ direction: 1
+ }
+ }
+};
// bar = 50 - foo
// Intersection is (foo=0 bar=50, foo=1 bar=49, ..., foo=10 bar=40)
-andix1ix2 = {andHash: {args: { nodes: [ixscan1, ixscan2]}}};
+andix1ix2 = {
+ andHash: {args: {nodes: [ixscan1, ixscan2]}}
+};
res = db.runCommand({stageDebug: {plan: andix1ix2, collection: collname}});
assert.eq(res.ok, 1);
assert.eq(res.results.length, 11);
// Filter predicates from 2 indices. Tests that we union the idx info.
-andix1ix2filter = {fetch: {filter: {bar: {$in: [45, 46, 48]}, foo: {$in: [4,5,6]}},
- args: {node: {andHash: {args: {nodes: [ixscan1, ixscan2]}}}}}};
+andix1ix2filter = {
+ fetch: {
+ filter: {bar: {$in: [45, 46, 48]}, foo: {$in: [4, 5, 6]}},
+ args: {node: {andHash: {args: {nodes: [ixscan1, ixscan2]}}}}
+ }
+};
res = db.runCommand({stageDebug: {collection: collname, plan: andix1ix2filter}});
assert.eq(res.ok, 1);
assert.eq(res.results.length, 2);