Files
mongo/jstests/core/write/update/update_blank1.js
2023-05-07 16:55:23 +00:00

15 lines
462 B
JavaScript

// Cannot implicitly shard accessed collections because of following errmsg: A single
// update/delete on a sharded collection must contain an exact match on _id or contain the shard
// key.
// @tags: [assumes_unsharded_collection]
let t = db.update_blank1;
t.drop();
let orig = {"": 1, _id: 2, "a": 3, "b": 4};
t.insert(orig);
var res = t.update({}, {$set: {"c": 5}});
print(res);
orig["c"] = 5;
assert.docEq(orig, t.findOne(), "after $set"); // SERVER-2651