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

c = db.find_and_modify_server6993;
c.drop();

c.insert({a: [1, 2]});

c.findAndModify({query: {a: 1}, update: {$set: {'a.$': 5}}});

assert.eq(5, c.findOne().a[0]);