summaryrefslogtreecommitdiff
path: root/jstests/core/update_invalid1.js
blob: bbda4cee53e9454800a050e34976d9ee1c066ea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// @tags: [
//   requires_fastcount,
// ]

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

t.update({_id: 5}, {$set: {$inc: {x: 5}}}, true);

// From version 5.0 on field names with dots and dollars are enabled and only top-level $-prefixed
// fields are validated. The field '$inc' appears at a lower level than the operator $set, so it is
// accepted by the update validation.
assert.eq(1, t.count(), "A1");