Skip to content

CDRIVER-5946 remove deprecated index management API #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 31, 2025

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Mar 28, 2025

Related to CDRIVER-5946. Followup to mongodb/mongo-c-driver#1957.

The mongoc_index_opt_* functions are not corrently used despite being added to mongoc.hh by CXX-687 (commit) due to their replacement with a BSON-based approach in CXX-1359 (commit). Therefore, it is sufficient to simply remove the functions from the list with no further changes required.

Note

mongocxx currently supports index management by manually constructing commands and passing them to mongoc_collection_write_command_with_opts.

The mongoc_index_storage_opt_type_t enumeration is being used, but only for the MONGOC_INDEX_STORAGE_OPT_WIREDTIGER enumerator in a very limited scope. The definition of the enumeration that was removed by mongodb/mongo-c-driver#1957 is copied as-is for traceability and backward compatibility. This can be simplified if preferable (the MONGOC_INDEX_STORAGE_OPT_MMAPV1 enumerator is unused).

Note

This copy is declared in bsoncxx::v_noabi::options and so does not conflict with the global namespace declaration provided by mongoc even when both are present.

No other changes seem to be required following mongodb/mongo-c-driver#1957, although we might want to consider deprecating the wiredtiger_storage_options class given its equivalents in the C Driver have been deprecated and removed.

@eramongodb eramongodb requested a review from kevinAlbs March 28, 2025 15:04
@eramongodb eramongodb self-assigned this Mar 28, 2025
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to consider deprecating the wiredtiger_storage_options class

I would be in favor. The spec uses a Document to represent storageEngine.

@eramongodb
Copy link
Contributor Author

Created CXX-3257 to track the removal of the now-deprecated storage_options() API. A new document-based storage_engine() interface was added in its place. Examples and tests have been updated accordingly.

@eramongodb eramongodb requested a review from kevinAlbs March 28, 2025 18:25
@eramongodb eramongodb merged commit 995f64a into mongodb:master Mar 31, 2025
1 check was pending
@eramongodb eramongodb deleted the cxx-cdriver-5946 branch March 31, 2025 15:40
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.

2 participants