Skip to content

Commit 87de663

Browse files
authored
CDRIVER-5709 remove cursor returning command helpers (#1919)
Removes `mongoc_client_command`, `mongoc_database_command`, and `mongoc_collection_command`.
1 parent 16a32cb commit 87de663

28 files changed

+57
-1283
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Unreleased (2.0.0)
1717
* `MONGOC_QUERY_SLAVE_OK` is removed. Use the equivalent `MONGOC_QUERY_SECONDARY_OK` instead.
1818
* `MONGOC_URI_SLAVEOK` is removed. It was unused.
1919
* `mongoc_collection_save` is removed. Use `mongoc_collection_insert_one` or `mongoc_collection_replace_one` instead.
20+
* `mongoc_client_command`, `mongoc_database_command`, and `mongoc_collection_command` are removed. Use `mongoc_client_command_simple`, `mongoc_database_command_simple`, and `mongoc_collection_command_simple` instead.
2021
* `MONGOC_URI_MAXIDLETIMEMS` and `MONGOC_URI_WAITQUEUEMULTIPLE` are removed. They were unused.
2122
* `bson_string_t` and associated functions are removed.
2223
* `mongoc_cursor_is_alive` is removed. Use the equivalent `mongoc_cursor_more` instead.

src/libmongoc/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,11 +1340,6 @@ if (ENABLE_EXAMPLES AND ENABLE_SHARED)
13401340
# examples/tutorial
13411341
mongoc_add_example (executing ${PROJECT_SOURCE_DIR}/examples/tutorial/executing.c)
13421342
mongoc_add_example (appending ${PROJECT_SOURCE_DIR}/examples/tutorial/appending.c)
1343-
mongoc_add_example (migrating ${PROJECT_SOURCE_DIR}/examples/migrating.c)
1344-
# Ignore deprecation warnings in migrating examples. Migrating examples deliberately call deprecated API to show how to migrate.
1345-
target_compile_options (migrating
1346-
PRIVATE $<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wno-deprecated-declarations>
1347-
)
13481343
endif ()
13491344

13501345
if (ENABLE_TESTS AND ENABLE_SHARED AND MONGOC_ENABLE_SSL AND NOT WIN32)

src/libmongoc/doc/mongoc_client_command.rst

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/libmongoc/doc/mongoc_client_command_simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Synopsis
1616
bson_t *reply,
1717
bson_error_t *error);
1818
19-
This is a simplified interface to :symbol:`mongoc_client_command()`. It returns the first document from the result cursor into ``reply``. The client's read preference, read concern, and write concern are not applied to the command.
19+
The client's read preference, read concern, and write concern are not applied to the command.
2020

2121
.. warning::
2222

src/libmongoc/doc/mongoc_client_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Example
5353
:maxdepth: 1
5454

5555
mongoc_client_bulkwrite_new
56-
mongoc_client_command
5756
mongoc_client_command_simple
5857
mongoc_client_command_simple_with_server_id
5958
mongoc_client_command_with_opts

src/libmongoc/doc/mongoc_collection_command.rst

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/libmongoc/doc/mongoc_collection_command_simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Parameters
2727
Description
2828
-----------
2929

30-
This is a simplified version of :symbol:`mongoc_collection_command()` that returns the first result document in ``reply``. The collection's read preference, read concern, and write concern are not applied to the command. The parameter ``reply`` is initialized even upon failure to simplify memory management.
30+
The collection's read preference, read concern, and write concern are not applied to the command. The parameter ``reply`` is initialized even upon failure to simplify memory management.
3131

3232
This function tries to unwrap an embedded error in the command when possible. The unwrapped error will be propagated via the ``error`` parameter. Additionally, the result document is set in ``reply``.
3333

src/libmongoc/doc/mongoc_collection_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Read preferences and write concerns are inherited from the parent client. They c
2727
:maxdepth: 1
2828

2929
mongoc_collection_aggregate
30-
mongoc_collection_command
3130
mongoc_collection_command_simple
3231
mongoc_collection_command_with_opts
3332
mongoc_collection_copy

src/libmongoc/doc/mongoc_database_command.rst

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/libmongoc/doc/mongoc_database_command_simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Parameters
2424
* ``reply``: A |bson_t-opt-storage-ptr| to contain the results.
2525
* ``error``: An optional location for a :symbol:`bson_error_t <errors>` or ``NULL``.
2626

27-
This is a simplified interface to :symbol:`mongoc_database_command()` that returns the first result document. The database's read preference, read concern, and write concern are not applied to the command. The parameter ``reply`` is initialized even upon failure to simplify memory management.
27+
The database's read preference, read concern, and write concern are not applied to the command. The parameter ``reply`` is initialized even upon failure to simplify memory management.
2828

2929
.. include:: includes/not-retryable-read.txt
3030

0 commit comments

Comments
 (0)