Original description: mongoc_collection_insert_many() does not batch legacy inserts for unacknowledged write concerns
While investigating PHPC-1351 and other places where allow_bulk_op_insert was set, I came across the three collection-level insert methods. mongoc_collection_insert_bulk() (since deprecated) always allows bulk inserts when calling _mongoc_write_command_init_insert(), but mongoc_collection_insert_one() and mongoc_collection_insert_many() never allow bulk inserts. This isn't a problem for the insert-one case, but it appears that mongoc_collection_insert_many() may not batch inserts for unacknowledged write concerns when connected to MongoDB versions before 3.6.
I quickly tested this by modifying example-command-monitoring.c to connect to a MongoDB 3.4 server using w=0. Running the example file shows that three insert commands are issued when I would expect two.
- is depended on by
-
PHPC-1351 executeBulkWrite() does not use bulk OP_INSERT when w=0
- Closed
- related to
-
CDRIVER-2573 APM reports incorrect command document for unacknowledged bulk writes
- Backlog