diff options
author | Mindaugas Malinauskas <mindaugas.malinauskas@mongodb.com> | 2020-08-19 16:41:55 +0300 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-24 12:16:37 +0000 |
commit | 8988d49ad6e5ebbbaa1d7b19a6e5b44d1c4dd87e (patch) | |
tree | d2fed1f99e936f50cb8d3ec43ff377a139f9b173 /jstests/core/doc_validation_options.js | |
parent | c986f14ab59177da4927429e41aa76f49a3079ff (diff) | |
download | mongo-8988d49ad6e5ebbbaa1d7b19a6e5b44d1c4dd87e.tar.gz |
SERVER-49234 Add '_id' field to generated errors for updates
Diffstat (limited to 'jstests/core/doc_validation_options.js')
-rw-r--r-- | jstests/core/doc_validation_options.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/jstests/core/doc_validation_options.js b/jstests/core/doc_validation_options.js index 0ec26697032..4b8e7e5b8e2 100644 --- a/jstests/core/doc_validation_options.js +++ b/jstests/core/doc_validation_options.js @@ -23,7 +23,7 @@ t.drop(); assert.commandWorked(db.createCollection(t.getName(), {validator: {a: 1}})); assertFailsValidation(t.insert({a: 2})); -t.insert({a: 1}); +t.insert({_id: 1, a: 1}); assert.eq(1, t.count()); // test default to strict @@ -42,10 +42,9 @@ assert.eq(1, t.find({a: 2}).itcount()); const conn = FixtureHelpers.getPrimaryForNodeHostingDatabase(db); const logId = 20294; const errInfo = { - "operatorName": "$eq", - "specifiedAs": {a: 1}, - "reason": "comparison failed", - "consideredValue": 2 + failingDocumentId: 1, + details: + {operatorName: "$eq", specifiedAs: {a: 1}, reason: "comparison failed", consideredValue: 2} }; checkLog.containsJson(conn, logId, { "errInfo": function(obj) { |