diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:17:50 -0500 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:18:14 -0500 |
commit | 4ae691e8edc87d0e3cfb633bb91c328426be007b (patch) | |
tree | 52079a593f54382ca13a2e741633eab1b6271893 /jstests/core/update_dbref.js | |
parent | a025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff) | |
download | mongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz |
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/update_dbref.js')
-rw-r--r-- | jstests/core/update_dbref.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/jstests/core/update_dbref.js b/jstests/core/update_dbref.js index d4c9ed7354f..71729c203e5 100644 --- a/jstests/core/update_dbref.js +++ b/jstests/core/update_dbref.js @@ -4,37 +4,39 @@ var res; t = db.jstests_update_dbref; t.drop(); -res = t.save({_id:1, a: new DBRef("a", "b")}); +res = t.save({_id: 1, a: new DBRef("a", "b")}); assert(!res.hasWriteError(), "failed to save dbref"); -assert.docEq({_id:1, a: new DBRef("a", "b")}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("a", "b")}, t.findOne()); res = t.update({}, {$set: {"a.$id": 2}}); assert(!res.hasWriteError(), "a.$id update"); -assert.docEq({_id:1, a: new DBRef("a", 2)}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("a", 2)}, t.findOne()); res = t.update({}, {$set: {"a.$ref": "b"}}); assert(!res.hasWriteError(), "a.$ref update"); -assert.docEq({_id:1, a: new DBRef("b", 2)}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("b", 2)}, t.findOne()); // Bad updates res = t.update({}, {$set: {"$id": 3}}); assert.writeError(res); assert(/\$id/.test(res.getWriteError()), "expected bad update because of $id"); -assert.docEq({_id:1, a: new DBRef("b", 2)}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("b", 2)}, t.findOne()); res = t.update({}, {$set: {"$ref": "foo"}}); assert.writeError(res); assert(/\$ref/.test(res.getWriteError()), "expected bad update because of $ref"); -assert.docEq({_id:1, a: new DBRef("b", 2)}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("b", 2)}, t.findOne()); res = t.update({}, {$set: {"$db": "aDB"}}); assert.writeError(res); assert(/\$db/.test(res.getWriteError()), "expected bad update because of $db"); -assert.docEq({_id:1, a: new DBRef("b", 2)}, t.findOne()); +assert.docEq({_id: 1, a: new DBRef("b", 2)}, t.findOne()); res = t.update({}, {$set: {"b.$id": 2}}); -assert(res.hasWriteError(), "b.$id update should fail -- doc:" + tojson(t.findOne()) + " result:" + res.toString()); +assert(res.hasWriteError(), + "b.$id update should fail -- doc:" + tojson(t.findOne()) + " result:" + res.toString()); res = t.update({}, {$set: {"b.$ref": 2}}); -assert(res.hasWriteError(), "b.$ref update should fail -- doc:" + tojson(t.findOne()) + " result:" + res.toString()); +assert(res.hasWriteError(), + "b.$ref update should fail -- doc:" + tojson(t.findOne()) + " result:" + res.toString()); |