Skip to content

Commit 609fa5e

Browse files
authored
CDRIVER-5937 remove deprecated mongoc_bulk_operation_* API (#1949)
1 parent cbec298 commit 609fa5e

9 files changed

+8
-192
lines changed

NEWS

+6
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@ Unreleased (2.0.0)
3838
* Support for LibreSSL (the CMake option `ENABLE_SSL=LIBRESSL`) is removed. Associated API is removed (`MONGOC_ENABLE_SSL_LIBRESSL` and `mongoc_stream_tls_libressl_new`).
3939
* `MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED` (value -1) is removed. Use `MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED` (value 0) which is handled equivalently. If specified in a URI, replace: `mongodb://host/?w=-1` with `mongodb://host/?w=0`.
4040
* The deprecated CMake option `ENABLE_AUTOMATIC_INIT_AND_CLEANUP` is removed. See [Initialization and cleanup](https://mongoc.org/libmongoc/1.30.2/init-cleanup.html) for expected use of `mongoc_init()` and `mongoc_cleanup()`.
41+
* Deprecated API for `mongoc_bulk_operation_t` is removed:
42+
* `mongoc_bulk_operation_delete` is removed. Use `mongoc_bulk_operation_remove()` instead.
43+
* `mongoc_bulk_operation_delete_one` is removed. Use `mongoc_bulk_operation_remove_one` instead.
44+
* `mongoc_bulk_operation_get_hint` is removed. Use `mongoc_bulk_operation_get_server_id` instead.
45+
* `mongoc_bulk_operation_set_hint` is removed. Use `mongoc_bulk_operation_set_server_id` instead.
4146
* Deprecated `mongoc_apm_command_*_get_server_connection_id` functions are removed. Use `mongoc_apm_command_*_get_server_connection_id_int64` instead.
4247

48+
4349
### Forwarding headers (`#include <bson.h>` and `#include <mongoc.h>`)
4450

4551
The compatibility "forwarding" headers have been removed (previously added in 1.13.0). This means it is no longer valid to include the literal header names `mongoc.h` or `bson.h` directly:

src/libmongoc/doc/mongoc_bulk_operation_delete.rst

-38
This file was deleted.

src/libmongoc/doc/mongoc_bulk_operation_delete_one.rst

-38
This file was deleted.

src/libmongoc/doc/mongoc_bulk_operation_get_hint.rst

-32
This file was deleted.

src/libmongoc/doc/mongoc_bulk_operation_set_hint.rst

-33
This file was deleted.

src/libmongoc/doc/mongoc_bulk_operation_t.rst

-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ After adding all of the write operations to the :symbol:`mongoc_bulk_operation_t
4242
:titlesonly:
4343
:maxdepth: 1
4444

45-
mongoc_bulk_operation_delete
46-
mongoc_bulk_operation_delete_one
4745
mongoc_bulk_operation_destroy
4846
mongoc_bulk_operation_execute
49-
mongoc_bulk_operation_get_hint
5047
mongoc_bulk_operation_get_server_id
5148
mongoc_bulk_operation_get_write_concern
5249
mongoc_bulk_operation_insert
@@ -60,7 +57,6 @@ After adding all of the write operations to the :symbol:`mongoc_bulk_operation_t
6057
mongoc_bulk_operation_set_bypass_document_validation
6158
mongoc_bulk_operation_set_client_session
6259
mongoc_bulk_operation_set_comment
63-
mongoc_bulk_operation_set_hint
6460
mongoc_bulk_operation_set_server_id
6561
mongoc_bulk_operation_set_let
6662
mongoc_bulk_operation_update

src/libmongoc/src/mongoc/mongoc-bulk-operation.c

-31
Original file line numberDiff line numberDiff line change
@@ -311,26 +311,6 @@ mongoc_bulk_operation_remove_one (mongoc_bulk_operation_t *bulk, /* IN */
311311
EXIT;
312312
}
313313

314-
void
315-
mongoc_bulk_operation_delete (mongoc_bulk_operation_t *bulk, const bson_t *selector)
316-
{
317-
ENTRY;
318-
319-
mongoc_bulk_operation_remove (bulk, selector);
320-
321-
EXIT;
322-
}
323-
324-
void
325-
mongoc_bulk_operation_delete_one (mongoc_bulk_operation_t *bulk, const bson_t *selector)
326-
{
327-
ENTRY;
328-
329-
mongoc_bulk_operation_remove_one (bulk, selector);
330-
331-
EXIT;
332-
}
333-
334314
void
335315
mongoc_bulk_operation_insert (mongoc_bulk_operation_t *bulk, const bson_t *document)
336316
{
@@ -925,12 +905,6 @@ mongoc_bulk_operation_set_client_session (mongoc_bulk_operation_t *bulk,
925905
}
926906

927907

928-
uint32_t
929-
mongoc_bulk_operation_get_hint (const mongoc_bulk_operation_t *bulk)
930-
{
931-
return mongoc_bulk_operation_get_server_id (bulk);
932-
}
933-
934908
uint32_t
935909
mongoc_bulk_operation_get_server_id (const mongoc_bulk_operation_t *bulk)
936910
{
@@ -939,11 +913,6 @@ mongoc_bulk_operation_get_server_id (const mongoc_bulk_operation_t *bulk)
939913
return bulk->server_id;
940914
}
941915

942-
void
943-
mongoc_bulk_operation_set_hint (mongoc_bulk_operation_t *bulk, uint32_t server_id)
944-
{
945-
mongoc_bulk_operation_set_server_id (bulk, server_id);
946-
}
947916

948917
void
949918
mongoc_bulk_operation_set_server_id (mongoc_bulk_operation_t *bulk, uint32_t server_id)

src/libmongoc/src/mongoc/mongoc-bulk-operation.h

-14
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ mongoc_bulk_operation_destroy (mongoc_bulk_operation_t *bulk);
4747
MONGOC_EXPORT (uint32_t)
4848
mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, bson_t *reply, bson_error_t *error);
4949

50-
BSON_DEPRECATED_FOR (mongoc_bulk_operation_remove)
51-
MONGOC_EXPORT (void) mongoc_bulk_operation_delete (mongoc_bulk_operation_t *bulk, const bson_t *selector);
52-
53-
BSON_DEPRECATED_FOR (mongoc_bulk_operation_remove_one)
54-
MONGOC_EXPORT (void) mongoc_bulk_operation_delete_one (mongoc_bulk_operation_t *bulk, const bson_t *selector);
55-
5650
MONGOC_EXPORT (void)
5751
mongoc_bulk_operation_insert (mongoc_bulk_operation_t *bulk, const bson_t *document);
5852

@@ -153,17 +147,9 @@ mongoc_bulk_operation_set_client (mongoc_bulk_operation_t *bulk, void *client);
153147
MONGOC_EXPORT (void)
154148
mongoc_bulk_operation_set_client_session (mongoc_bulk_operation_t *bulk,
155149
struct _mongoc_client_session_t *client_session);
156-
// `mongoc_bulk_operation_set_hint` is deprecated for the more aptly named `mongoc_bulk_operation_set_server_id`.
157-
158-
BSON_DEPRECATED_FOR (mongoc_bulk_operation_set_server_id)
159-
MONGOC_EXPORT (void) mongoc_bulk_operation_set_hint (mongoc_bulk_operation_t *bulk, uint32_t server_id);
160150

161151
MONGOC_EXPORT (void)
162152
mongoc_bulk_operation_set_server_id (mongoc_bulk_operation_t *bulk, uint32_t server_id);
163-
// `mongoc_bulk_operation_get_hint` is deprecated for the more aptly named `mongoc_bulk_operation_get_server_id`.
164-
165-
BSON_DEPRECATED_FOR (mongoc_bulk_operation_get_server_id)
166-
MONGOC_EXPORT (uint32_t) mongoc_bulk_operation_get_hint (const mongoc_bulk_operation_t *bulk);
167153

168154
MONGOC_EXPORT (uint32_t)
169155
mongoc_bulk_operation_get_server_id (const mongoc_bulk_operation_t *bulk);

src/libmongoc/tests/test-mongoc-bulk.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4689,12 +4689,12 @@ test_bulk_write_multiple_errors (void *unused)
46894689

46904690
mongoc_bulk_operation_insert (bulk,
46914691
tmp_bson ("{'_id': 1}")); // fail via failPoint
4692-
mongoc_bulk_operation_delete (bulk,
4692+
mongoc_bulk_operation_remove (bulk,
46934693
tmp_bson ("{'_id': 1}")); // fail via failPoint
46944694

46954695
mongoc_bulk_operation_insert (bulk, tmp_bson ("{'_id': 4}")); // succeed
46964696

4697-
mongoc_bulk_operation_delete (bulk, tmp_bson ("{'_id': 4}")); // suceed
4697+
mongoc_bulk_operation_remove (bulk, tmp_bson ("{'_id': 4}")); // suceed
46984698

46994699
mongoc_bulk_operation_insert (bulk, tmp_bson ("{'_id': 5}")); // suceed
47004700
mongoc_bulk_operation_insert (bulk, tmp_bson ("{'_id': 5}")); // duplicate key error

0 commit comments

Comments
 (0)