Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
Description
Given the following code sample:
if (!mongoc_collection_insert_one(collection, insert, NULL, &reply, &error)) { |
printf("err inserting reply: %s err: %s\n", bson_as_relaxed_extended_json(&reply, NULL), error.message); |
} else { |
printf("success: %s\n", bson_as_relaxed_extended_json(&reply, NULL)); |
}
|
it prints
success: { "insertedCount" : 1, "writeConcernErrors" : [ { "code" : 91.0, "errmsg" : "Replication is being shut down" } ] }
|
when encountering a write concern error. This means the function returned true, even though the docs state that a write concern error should be considered a failure. I believe this applies to the other crud functions as well (including bulk writes).