{ "_comment": [ "Inputs only. Expectations are measured -- see record.js.", "The operator table itself, rather than any one operator: what an update", "document may be, and what happens to a name that is not in the table.", "This server answers `bad update` with code 2 to every one of these, which", "is one message covering several different questions.", "A `{b: 1, $set: {...}}` case was authored and then removed: the driver", "rejects it before it reaches a server, so there is no server answer to", "record and a case with no `errorCode` would assert nothing." ], "documents": [{ "_id": 1, "a": 1, "t": [1, 2] }], "cases": [ { "description": "an unknown modifier", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$bogus": { "a": 1 } } } }, { "description": "an unknown modifier beside a known one", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": { "b": 1 }, "$bogus": { "a": 1 } } } }, { "description": "a known modifier whose argument is not a document", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": 1 } } }, { "description": "an empty argument to a known modifier", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": {} } } }, { "description": "a data field after an operator", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": { "c": 1 }, "b": 1 } } }, { "description": "two operators writing the same field", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": { "a": 2 }, "$inc": { "a": 1 } } } }, { "description": "$inc on a non-numeric field", "documents": [{ "_id": 1, "a": "x" }], "operation": "updateOne", "arguments": { "filter": {}, "update": { "$inc": { "a": 1 } } } }, { "description": "$inc by a non-numeric operand", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$inc": { "a": "x" } } } }, { "description": "$push onto a non-array field", "documents": [{ "_id": 1, "t": 5 }], "operation": "updateOne", "arguments": { "filter": {}, "update": { "$push": { "t": 1 } } } }, { "description": "$pull on a non-array field", "documents": [{ "_id": 1, "t": 5 }], "operation": "updateOne", "arguments": { "filter": {}, "update": { "$pull": { "t": 1 } } } }, { "description": "$unset of a field that is not there", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$unset": { "gone": "" } } } }, { "description": "$rename onto a field that already exists", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$rename": { "a": "t" } } } }, { "description": "$rename of a field that is not there", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$rename": { "gone": "b" } } } }, { "description": "an update that writes nothing still reports a match", "operation": "updateOne", "arguments": { "filter": {}, "update": { "$set": { "a": 1 } } } } ] }