Skip to content

CDRIVER-5946 remove deprecated index management API #1957

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 12 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .evergreen/config_generator/components/earthly.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Valid options for the SASL configuration parameter"
TLSOption = Literal["OpenSSL", "off"]
"Options for the TLS backend configuration parameter (AKA 'ENABLE_SSL')"
CxxVersion = Literal["r4.0.0", "none"]
CxxVersion = Literal["none"] # TODO: Once CXX-3103 is released, add latest C++ release tag.
"C++ driver refs that are under CI test"

# A separator character, since we cannot use whitespace
Expand Down Expand Up @@ -146,10 +146,6 @@ def task_filter(env: EarthlyVariant, conf: Configuration) -> bool:
case e, (_sasl, _tls, cxx) if re.match(r"^Ubuntu 16|^CentOS 7", e.display_name):
# Only build if C++ driver is test is disabled
return cxx == "none"
# Skip other platforms where the C++ driver test is disabled, since they would be
# redundant
case _, (_sasl, _tls, "none"):
return False
# Anything else: Allow it to run:
case _:
return True
Expand Down
168 changes: 4 additions & 164 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ tasks:
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, centos7-clang, centos7-gcc, u16-clang, u16-gcc]
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, centos7-clang, centos7-gcc, u16-clang, u16-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
Expand Down Expand Up @@ -1137,53 +1137,13 @@ tasks:
- --test_mongocxx_ref=none
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=Cyrus\_\u2022\_tls=OpenSSL\_\u2022\_test_mongocxx_ref=r4.0.0"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
params:
binary: bash
args:
- -c
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
- command: subprocess.exec
type: setup
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +env-warmup
- --sasl=Cyrus
- --tls=OpenSSL
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- command: subprocess.exec
type: test
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +run
- --targets=test-example test-cxx-driver
- --sasl=Cyrus
- --tls=OpenSSL
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=Cyrus\_\u2022\_tls=off\_\u2022\_test_mongocxx_ref=none"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, centos7-clang, centos7-gcc, u16-clang, u16-gcc]
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, centos7-clang, centos7-gcc, u16-clang, u16-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
Expand Down Expand Up @@ -1217,53 +1177,13 @@ tasks:
- --test_mongocxx_ref=none
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=Cyrus\_\u2022\_tls=off\_\u2022\_test_mongocxx_ref=r4.0.0"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
params:
binary: bash
args:
- -c
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
- command: subprocess.exec
type: setup
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +env-warmup
- --sasl=Cyrus
- --tls=off
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- command: subprocess.exec
type: test
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +run
- --targets=test-example test-cxx-driver
- --sasl=Cyrus
- --tls=off
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=off\_\u2022\_tls=OpenSSL\_\u2022\_test_mongocxx_ref=none"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, centos7-clang, centos7-gcc, u16-clang, u16-gcc]
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, centos7-clang, centos7-gcc, u16-clang, u16-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
Expand Down Expand Up @@ -1297,53 +1217,13 @@ tasks:
- --test_mongocxx_ref=none
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=off\_\u2022\_tls=OpenSSL\_\u2022\_test_mongocxx_ref=r4.0.0"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
params:
binary: bash
args:
- -c
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
- command: subprocess.exec
type: setup
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +env-warmup
- --sasl=off
- --tls=OpenSSL
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- command: subprocess.exec
type: test
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +run
- --targets=test-example test-cxx-driver
- --sasl=off
- --tls=OpenSSL
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=off\_\u2022\_tls=off\_\u2022\_test_mongocxx_ref=none"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, centos7-clang, centos7-gcc, u16-clang, u16-gcc]
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, centos7-clang, centos7-gcc, u16-clang, u16-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
Expand Down Expand Up @@ -1377,46 +1257,6 @@ tasks:
- --test_mongocxx_ref=none
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: "check:sasl=off\_\u2022\_tls=off\_\u2022\_test_mongocxx_ref=r4.0.0"
run_on:
- ubuntu2204-large
- debian10-large
- debian11-large
- amazon2
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc, u18-clang, u18-gcc, u20-clang, u20-gcc, u22-clang, u22-gcc]
commands:
- command: subprocess.exec
type: setup
params:
binary: bash
args:
- -c
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
- command: subprocess.exec
type: setup
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +env-warmup
- --sasl=off
- --tls=off
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- command: subprocess.exec
type: test
params:
binary: ./tools/earthly.sh
working_dir: mongoc
args:
- +run
- --targets=test-example test-cxx-driver
- --sasl=off
- --tls=off
- --test_mongocxx_ref=r4.0.0
- --env=${MONGOC_EARTHLY_ENV}
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
- name: clang-format
tags: [clang-format]
commands:
Expand Down
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ Unreleased (2.0.0)
* `mongoc_bulk_operation_delete_one` is removed. Use `mongoc_bulk_operation_remove_one` instead.
* `mongoc_bulk_operation_get_hint` is removed. Use `mongoc_bulk_operation_get_server_id` instead.
* `mongoc_bulk_operation_set_hint` is removed. Use `mongoc_bulk_operation_set_server_id` instead.
* Deprecated `mongoc_apm_command_*_get_server_connection_id` functions are removed. Use `mongoc_apm_command_*_get_server_connection_id_int64` instead.
* Deprecated index management API has been removed:
* `mongoc_collection_create_index_with_opts`, `mongoc_collection_create_index`, and `mongoc_collection_ensure_index` are removed. Use `mongoc_collection_create_indexes_with_opts` instead.
* `mongoc_index_opt_t`, `mongoc_index_opt_geo_t` `mongoc_index_opt_wt_t` are removed. Pass options using `bson_t` to `mongoc_collection_create_indexes_with_opts` instead.
* `mongoc_collection_find_indexes` is removed. Use `mongoc_collection_find_indexes_with_opts` instead.
* See [MongoDB documentation](https://www.mongodb.com/docs/languages/c/c-driver/current/indexes/) for working with indexes.

### Forwarding headers (`#include <bson.h>` and `#include <mongoc.h>`)

Expand Down
8 changes: 4 additions & 4 deletions build/generate-future-functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
typedef("mongoc_iovec_ptr", "mongoc_iovec_t *"),
typedef("mongoc_server_stream_ptr", "mongoc_server_stream_t *"),
typedef("mongoc_query_flags_t", None),
typedef("const_mongoc_index_opt_t", "const mongoc_index_opt_t *"),
typedef("mongoc_server_description_ptr", "mongoc_server_description_t *"),
typedef("mongoc_ss_optype_t", None),
typedef("mongoc_topology_ptr", "mongoc_topology_t *"),
Expand All @@ -104,6 +103,7 @@
"const mongoc_write_concern_t *"),
typedef("const_mongoc_ss_log_context_ptr",
"const mongoc_ss_log_context_t *"),
typedef("mongoc_index_model_t_ptr_const_ptr", "mongoc_index_model_t *const *")
]

type_list = [T.name for T in typedef_list]
Expand Down Expand Up @@ -237,10 +237,10 @@
param("bson_error_ptr", "error")]),

future_function("bool",
"mongoc_collection_create_index_with_opts",
"mongoc_collection_create_indexes_with_opts",
[param("mongoc_collection_ptr", "collection"),
param("const_bson_ptr", "keys"),
param("const_mongoc_index_opt_t", "opt"),
param("mongoc_index_model_t_ptr_const_ptr", "models"),
param("size_t", "num_models"),
param("const_bson_ptr", "opts"),
param("bson_ptr", "reply"),
param("bson_error_ptr", "error")]),
Expand Down
2 changes: 0 additions & 2 deletions src/libmongoc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ set (MONGOC_SOURCES
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-handshake.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-host-list.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-http.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-index.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-init.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-interrupt.c
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-list.c
Expand Down Expand Up @@ -713,7 +712,6 @@ set (HEADERS
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-handshake.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-host-list.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-init.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-index.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-iovec.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-log.h
${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-macros.h
Expand Down
3 changes: 0 additions & 3 deletions src/libmongoc/doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ API Reference
mongoc_gridfs_bucket_t
mongoc_gridfs_t
mongoc_host_list_t
mongoc_index_opt_geo_t
mongoc_index_opt_t
mongoc_index_opt_wt_t
mongoc_insert_flags_t
mongoc_iovec_t
mongoc_optional_t
Expand Down
2 changes: 1 addition & 1 deletion src/libmongoc/doc/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Many C Driver functions report errors by returning ``false`` or -1 and filling o
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``MONGOC_ERROR_SASL`` | A SASL error code. | ``man sasl_errors`` for a list of codes. |
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``MONGOC_ERROR_BSON`` | ``MONGOC_ERROR_BSON_INVALID`` | You passed an invalid or oversized BSON document as a parameter, or called :symbol:`mongoc_collection_create_index` with invalid keys, or the server reply was corrupt. |
| ``MONGOC_ERROR_BSON`` | ``MONGOC_ERROR_BSON_INVALID`` | You passed an invalid or oversized BSON document as a parameter or the server reply was corrupt. |
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``MONGOC_ERROR_NAMESPACE`` | ``MONGOC_ERROR_NAMESPACE_INVALID`` | You tried to create a collection with an invalid name. |
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down
28 changes: 0 additions & 28 deletions src/libmongoc/doc/mongoc_collection_create_index.rst

This file was deleted.

Loading