summaryrefslogtreecommitdiff
path: root/jstests/core/system_profile.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/system_profile.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/system_profile.js')
-rw-r--r--jstests/core/system_profile.js32
1 files changed, 18 insertions, 14 deletions
diff --git a/jstests/core/system_profile.js b/jstests/core/system_profile.js
index abfa0c98832..73d303a3277 100644
--- a/jstests/core/system_profile.js
+++ b/jstests/core/system_profile.js
@@ -26,21 +26,25 @@ assert.writeError(testDB.system.profile.remove({}));
// Using findAndModify to write to "system.profile" should fail.
assert.commandWorked(testDB.dropDatabase());
assert.commandWorked(testDB.createCollection("system.profile"));
-assert.commandFailed(
- testDB.system.profile.runCommand("findAndModify", {query: {}, update: {a: 1}}));
-assert.commandFailed(
- testDB.system.profile.runCommand("findAndModify", {query: {}, update: {a: 1}, upsert: true}));
+assert.commandFailed(testDB.system.profile.runCommand("findAndModify",
+ {query: {}, update: {a: 1}}));
+assert.commandFailed(testDB.system.profile.runCommand("findAndModify",
+ {query: {}, update: {a: 1}, upsert: true}));
assert.commandFailed(testDB.system.profile.runCommand("findAndModify", {query: {}, remove: true}));
// Using mapReduce to write to "system.profile" should fail.
assert.commandWorked(testDB.dropDatabase());
assert.writeOK(testDB.foo.insert({val: 1}));
assert.commandFailed(testDB.foo.runCommand("mapReduce",
- {map: function() { emit(0, this.val); },
- reduce: function(id, values) {
+ {
+ map: function() {
+ emit(0, this.val);
+ },
+ reduce: function(id, values) {
return Array.sum(values);
- },
- out: "system.profile"}));
+ },
+ out: "system.profile"
+ }));
// Using aggregate to write to "system.profile" should fail.
assert.commandWorked(testDB.dropDatabase());
@@ -50,12 +54,12 @@ assert.commandFailed(testDB.foo.runCommand("aggregate", {pipeline: [{$out: "syst
// Renaming to/from "system.profile" should fail.
assert.commandWorked(testDB.dropDatabase());
assert.commandWorked(testDB.createCollection("system.profile"));
-assert.commandFailed(testDB.adminCommand({renameCollection: testDB.system.profile.getFullName(),
- to: testDB.foo.getFullName()}));
+assert.commandFailed(testDB.adminCommand(
+ {renameCollection: testDB.system.profile.getFullName(), to: testDB.foo.getFullName()}));
assert.commandWorked(testDB.dropDatabase());
assert.commandWorked(testDB.createCollection("foo"));
-assert.commandFailed(testDB.adminCommand({renameCollection: testDB.foo.getFullName(),
- to: testDB.system.profile.getFullName()}));
+assert.commandFailed(testDB.adminCommand(
+ {renameCollection: testDB.foo.getFullName(), to: testDB.system.profile.getFullName()}));
// Copying a database containing "system.profile" should succeed. The "system.profile" collection
// should not be copied.
@@ -63,7 +67,7 @@ assert.commandWorked(testDB.dropDatabase());
assert.commandWorked(testDB.createCollection("foo"));
assert.commandWorked(testDB.createCollection("system.profile"));
assert.commandWorked(testDBCopy.dropDatabase());
-assert.commandWorked(testDB.adminCommand({copydb: 1, fromdb: testDB.getName(),
- todb: testDBCopy.getName()}));
+assert.commandWorked(
+ testDB.adminCommand({copydb: 1, fromdb: testDB.getName(), todb: testDBCopy.getName()}));
assert.commandWorked(testDBCopy.foo.stats());
assert.commandFailed(testDBCopy.system.profile.stats());