summaryrefslogtreecommitdiff
path: root/jstests/core/write_commands_reject_unknown_fields.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/write_commands_reject_unknown_fields.js')
-rw-r--r--jstests/core/write_commands_reject_unknown_fields.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/jstests/core/write_commands_reject_unknown_fields.js b/jstests/core/write_commands_reject_unknown_fields.js
index d21cf2ed9f3..a7f834280d1 100644
--- a/jstests/core/write_commands_reject_unknown_fields.js
+++ b/jstests/core/write_commands_reject_unknown_fields.js
@@ -3,19 +3,19 @@
// SERVER-23129 Write commands should reject unknown fields. This is run in passthrough tests to
// ensure that both mongos and mongod reject these commands.
(function() {
- 'use strict';
+'use strict';
- var coll = db.write_commands_reject_unknown_fields;
+var coll = db.write_commands_reject_unknown_fields;
- // All commands must reject fields at the top-level.
- assert.commandFailed(coll.runCommand('insert', {documents: [{}], asdf: true}));
- assert.commandFailed(
- coll.runCommand('update', {updates: [{q: {}, u: {$inc: {a: 1}}}], asdf: true}));
- assert.commandFailed(coll.runCommand('delete', {deletes: [{q: {}, limit: 0}], asdf: true}));
+// All commands must reject fields at the top-level.
+assert.commandFailed(coll.runCommand('insert', {documents: [{}], asdf: true}));
+assert.commandFailed(
+ coll.runCommand('update', {updates: [{q: {}, u: {$inc: {a: 1}}}], asdf: true}));
+assert.commandFailed(coll.runCommand('delete', {deletes: [{q: {}, limit: 0}], asdf: true}));
- // The inner objects in update and delete must also reject unknown fields. Insert isn't included
- // because its inner objects are the raw objects to insert and can have any fields.
- assert.commandFailed(
- coll.runCommand('update', {updates: [{q: {}, u: {$inc: {a: 1}}, asdf: true}]}));
- assert.commandFailed(coll.runCommand('delete', {deletes: [{q: {}, limit: 0, asdf: true}]}));
+// The inner objects in update and delete must also reject unknown fields. Insert isn't included
+// because its inner objects are the raw objects to insert and can have any fields.
+assert.commandFailed(
+ coll.runCommand('update', {updates: [{q: {}, u: {$inc: {a: 1}}, asdf: true}]}));
+assert.commandFailed(coll.runCommand('delete', {deletes: [{q: {}, limit: 0, asdf: true}]}));
}());