Skip to content

Conversation

Julia-Garland
Copy link
Contributor

@Julia-Garland Julia-Garland commented Aug 27, 2025

Summary

mongoc_collection_create_indexes_with_opts uses mongoc_client_command_with_opts rather than mongoc_collection_write_command_with_opts. As a result, write command behavior is not applied:

  • Write concern is not inherited from the parent mongoc_collection_t (contrary to documentation)
  • A server reply with a "writeConcernError" does not result in a failing return.

These changes now call mongoc_collection_write_command_with_opts.

A test was added to reproduce the errors in the original code and confirm that write command behavior is fixed with the correct call.

@Julia-Garland Julia-Garland changed the title Use mongoc_collection_write_command_with_opts CDRIVER-5945 mongoc_collection_create_indexes_with_opts does not apply write command behavior Aug 27, 2025
@Julia-Garland Julia-Garland self-assigned this Aug 27, 2025
@Julia-Garland Julia-Garland marked this pull request as ready for review August 28, 2025 13:41
@Julia-Garland Julia-Garland requested a review from a team as a code owner August 28, 2025 13:41
@Julia-Garland Julia-Garland requested review from mdb-ad and vector-of-bool and removed request for mdb-ad August 28, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant