summaryrefslogtreecommitdiff
path: root/jstests/core/index_partial_write_ops.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/index_partial_write_ops.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/index_partial_write_ops.js')
-rw-r--r--jstests/core/index_partial_write_ops.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/jstests/core/index_partial_write_ops.js b/jstests/core/index_partial_write_ops.js
index 92d3720d07e..b962347a26d 100644
--- a/jstests/core/index_partial_write_ops.js
+++ b/jstests/core/index_partial_write_ops.js
@@ -5,13 +5,12 @@
var isMongos = (db.runCommand("isMaster").msg === "isdbgrid");
var coll = db.index_partial_write_ops;
- var getNumKeys = function (idxName) {
+ var getNumKeys = function(idxName) {
var res = assert.commandWorked(coll.validate(true));
var kpi;
if (isMongos) {
kpi = res.raw[Object.getOwnPropertyNames(res.raw)[0]].keysPerIndex;
- }
- else {
+ } else {
kpi = res.keysPerIndex;
}
return kpi[coll.getFullName() + ".$" + idxName];
@@ -22,8 +21,8 @@
// Create partial index.
assert.commandWorked(coll.ensureIndex({x: 1}, {partialFilterExpression: {a: 1}}));
- assert.writeOK(coll.insert({_id: 1, x: 5, a: 2, b: 1})); // Not in index.
- assert.writeOK(coll.insert({_id: 2, x: 6, a: 1, b: 1})); // In index.
+ assert.writeOK(coll.insert({_id: 1, x: 5, a: 2, b: 1})); // Not in index.
+ assert.writeOK(coll.insert({_id: 2, x: 6, a: 1, b: 1})); // In index.
assert.eq(1, getNumKeys("x_1"));