summaryrefslogtreecommitdiff
path: root/jstests/core/set3.js
blob: 4af579fa0b9a8fb72597200b70bccbee768a0852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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]

t = db.set3;
t.drop();

t.insert({"test1": {"test2": {"abcdefghijklmnopqrstu": {"id": 1}}}});
t.update({}, {"$set": {"test1.test2.abcdefghijklmnopqrstuvwxyz": {"id": 2}}});

x = t.findOne();
assert.eq(1, x.test1.test2.abcdefghijklmnopqrstu.id, "A");
assert.eq(2, x.test1.test2.abcdefghijklmnopqrstuvwxyz.id, "B");