Files
mongo/jstests/core/query/update/update_invalid1.js
Mihai Andrei 5ed8f7dcf5 SERVER-93427 Move query writing tests from jstests/core/write to jstests/core/query (#31702)
GitOrigin-RevId: 2d69ca12e591fda58c4a5387ffae9d97c0ef2283
2025-02-04 19:38:51 +00:00

14 lines
423 B
JavaScript

// @tags: [
// requires_fastcount,
// ]
const t = db[jsTestName()];
t.drop();
assert.commandWorked(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");