summaryrefslogtreecommitdiff
path: root/jstests/aggregation/mongos_slaveok.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/aggregation/mongos_slaveok.js
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/aggregation/mongos_slaveok.js')
-rw-r--r--jstests/aggregation/mongos_slaveok.js52
1 files changed, 25 insertions, 27 deletions
diff --git a/jstests/aggregation/mongos_slaveok.js b/jstests/aggregation/mongos_slaveok.js
index 24346e407f0..a0ccf2d1100 100644
--- a/jstests/aggregation/mongos_slaveok.js
+++ b/jstests/aggregation/mongos_slaveok.js
@@ -8,43 +8,41 @@
* ]
*/
(function() {
- load('jstests/replsets/rslib.js');
+load('jstests/replsets/rslib.js');
- var NODES = 2;
+var NODES = 2;
- var doTest = function(st, doSharded) {
- var testDB = st.s.getDB('test');
+var doTest = function(st, doSharded) {
+ var testDB = st.s.getDB('test');
- if (doSharded) {
- testDB.adminCommand({enableSharding: 'test'});
- testDB.adminCommand({shardCollection: 'test.user', key: {x: 1}});
- }
+ if (doSharded) {
+ testDB.adminCommand({enableSharding: 'test'});
+ testDB.adminCommand({shardCollection: 'test.user', key: {x: 1}});
+ }
- testDB.user.insert({x: 10}, {writeConcern: {w: NODES}});
- testDB.setSlaveOk(true);
+ testDB.user.insert({x: 10}, {writeConcern: {w: NODES}});
+ testDB.setSlaveOk(true);
- var secNode = st.rs0.getSecondary();
- secNode.getDB('test').setProfilingLevel(2);
+ var secNode = st.rs0.getSecondary();
+ secNode.getDB('test').setProfilingLevel(2);
- // wait for mongos to recognize that the slave is up
- awaitRSClientHosts(st.s, secNode, {ok: true});
+ // wait for mongos to recognize that the slave is up
+ awaitRSClientHosts(st.s, secNode, {ok: true});
- var res =
- testDB.runCommand({aggregate: 'user', pipeline: [{$project: {x: 1}}], cursor: {}});
- assert(res.ok, 'aggregate command failed: ' + tojson(res));
+ var res = testDB.runCommand({aggregate: 'user', pipeline: [{$project: {x: 1}}], cursor: {}});
+ assert(res.ok, 'aggregate command failed: ' + tojson(res));
- var profileQuery = {op: 'command', ns: 'test.user', 'command.aggregate': 'user'};
- var profileDoc = secNode.getDB('test').system.profile.findOne(profileQuery);
+ var profileQuery = {op: 'command', ns: 'test.user', 'command.aggregate': 'user'};
+ var profileDoc = secNode.getDB('test').system.profile.findOne(profileQuery);
- assert(profileDoc != null);
- testDB.dropDatabase();
- };
+ assert(profileDoc != null);
+ testDB.dropDatabase();
+};
- var st = new ShardingTest({shards: {rs0: {oplogSize: 10, nodes: NODES}}});
+var st = new ShardingTest({shards: {rs0: {oplogSize: 10, nodes: NODES}}});
- doTest(st, false);
- doTest(st, true);
-
- st.stop();
+doTest(st, false);
+doTest(st, true);
+st.stop();
})();