Skip to content

Commit f21649c

Browse files
jmikolahanumantmk
authored andcommitted
CDRIVER-554: Inherit write concern in collection update/bulk
Closes #183
1 parent 746d250 commit f21649c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mongoc/mongoc-collection.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,10 @@ mongoc_collection_update (mongoc_collection_t *collection,
12371237

12381238
bson_clear (&collection->gle);
12391239

1240+
if (!write_concern) {
1241+
write_concern = collection->write_concern;
1242+
}
1243+
12401244
if (!((uint32_t)flags & MONGOC_UPDATE_NO_VALIDATE) &&
12411245
bson_iter_init (&iter, update) &&
12421246
bson_iter_next (&iter) &&
@@ -1799,6 +1803,10 @@ mongoc_collection_create_bulk_operation (
17991803
{
18001804
bson_return_val_if_fail (collection, NULL);
18011805

1806+
if (!write_concern) {
1807+
write_concern = collection->write_concern;
1808+
}
1809+
18021810
/*
18031811
* TODO: where should we discover if we can do new or old style bulk ops?
18041812
*/

0 commit comments

Comments
 (0)