summaryrefslogtreecommitdiff
path: root/jstests/core/stages_and_sorted.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_sorted.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/stages_and_sorted.js')
-rw-r--r--jstests/core/stages_and_sorted.js57
1 files changed, 44 insertions, 13 deletions
diff --git a/jstests/core/stages_and_sorted.js b/jstests/core/stages_and_sorted.js
index e6e493de5f7..c29db7ce2eb 100644
--- a/jstests/core/stages_and_sorted.js
+++ b/jstests/core/stages_and_sorted.js
@@ -10,9 +10,9 @@ for (var i = 0; i < N; ++i) {
t.insert({baz: 12});
t.insert({bar: 1});
// This is the only thing that should be outputted in the and.
- t.insert({foo: 1, bar:1, baz: 12});
+ t.insert({foo: 1, bar: 1, baz: 12});
t.insert({bar: 1});
- t.insert({bar:1, baz: 12});
+ t.insert({bar: 1, baz: 12});
t.insert({baz: 12});
t.insert({foo: 1, baz: 12});
t.insert({baz: 12});
@@ -23,29 +23,60 @@ t.ensureIndex({bar: 1});
t.ensureIndex({baz: 1});
// Scan foo == 1
-ixscan1 = {ixscan: {args:{name: "stages_and_sorted", keyPattern:{foo: 1},
- startKey: {"": 1}, endKey: {"": 1},
- endKeyInclusive: true, direction: 1}}};
+ixscan1 = {
+ ixscan: {
+ args: {
+ name: "stages_and_sorted",
+ keyPattern: {foo: 1},
+ startKey: {"": 1},
+ endKey: {"": 1},
+ endKeyInclusive: true,
+ direction: 1
+ }
+ }
+};
// Scan bar == 1
-ixscan2 = {ixscan: {args:{name: "stages_and_sorted", keyPattern:{bar: 1},
- startKey: {"": 1}, endKey: {"": 1},
- endKeyInclusive: true, direction: 1}}};
+ixscan2 = {
+ ixscan: {
+ args: {
+ name: "stages_and_sorted",
+ keyPattern: {bar: 1},
+ startKey: {"": 1},
+ endKey: {"": 1},
+ endKeyInclusive: true,
+ direction: 1
+ }
+ }
+};
// Scan baz == 12
-ixscan3 = {ixscan: {args:{name: "stages_and_sorted", keyPattern:{baz: 1},
- startKey: {"": 12}, endKey: {"": 12},
- endKeyInclusive: true, direction: 1}}};
+ixscan3 = {
+ ixscan: {
+ args: {
+ name: "stages_and_sorted",
+ keyPattern: {baz: 1},
+ startKey: {"": 12},
+ endKey: {"": 12},
+ endKeyInclusive: true,
+ direction: 1
+ }
+ }
+};
// Intersect foo==1 with bar==1 with baz==12.
-andix1ix2 = {andSorted: {args: {nodes: [ixscan1, ixscan2, ixscan3]}}};
+andix1ix2 = {
+ andSorted: {args: {nodes: [ixscan1, ixscan2, ixscan3]}}
+};
res = db.runCommand({stageDebug: {collection: collname, plan: andix1ix2}});
printjson(res);
assert.eq(res.ok, 1);
assert.eq(res.results.length, N);
// Might as well make sure that hashed does the same thing.
-andix1ix2hash = {andHash: {args: {nodes: [ixscan1, ixscan2, ixscan3]}}};
+andix1ix2hash = {
+ andHash: {args: {nodes: [ixscan1, ixscan2, ixscan3]}}
+};
res = db.runCommand({stageDebug: {collection: collname, plan: andix1ix2hash}});
assert.eq(res.ok, 1);
assert.eq(res.results.length, N);