Skip to content

Commit a5fbace

Browse files
authored
CDRIVER-5711 remove mongoc_collection_delete and unused flags (#1923)
* remove `mongoc_collection_delete` * remove `mongoc_delete_flags_t` * remove `mongoc_reply_flags_t` from public API
1 parent 803d005 commit a5fbace

13 files changed

+13
-198
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Unreleased (2.0.0)
1616
* `MONGOC_QUERY_SLAVE_OK` is removed. Use the equivalent `MONGOC_QUERY_SECONDARY_OK` instead.
1717
* `MONGOC_URI_SLAVEOK` is removed. It was unused.
1818
* `mongoc_collection_save` is removed. Use `mongoc_collection_insert_one` or `mongoc_collection_replace_one` instead.
19+
* `mongoc_collection_delete` is removed. Use `mongoc_collection_delete_one` or `mongoc_collection_delete_many` instead.
20+
* `mongoc_delete_flags_t` and `mongoc_reply_flags_t` are removed.
1921

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

src/libmongoc/doc/api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ API Reference
3030
mongoc_collection_t
3131
mongoc_cursor_t
3232
mongoc_database_t
33-
mongoc_delete_flags_t
3433
mongoc_find_and_modify_opts_t
3534
mongoc_gridfs_file_list_t
3635
mongoc_gridfs_file_opt_t
@@ -50,7 +49,6 @@ API Reference
5049
mongoc_read_mode_t
5150
mongoc_read_prefs_t
5251
mongoc_remove_flags_t
53-
mongoc_reply_flags_t
5452
mongoc_server_api_t
5553
mongoc_server_api_version_t
5654
mongoc_server_description_t

src/libmongoc/doc/mongoc_collection_delete.rst

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

src/libmongoc/doc/mongoc_collection_get_last_error.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Description
3939

4040
- :symbol:`mongoc_collection_update`
4141
- :symbol:`mongoc_collection_remove`
42-
- :symbol:`mongoc_collection_delete`
4342
- :symbol:`mongoc_collection_insert_bulk`
4443
- :symbol:`mongoc_collection_insert`
4544

src/libmongoc/doc/mongoc_collection_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Read preferences and write concerns are inherited from the parent client. They c
4040
mongoc_collection_create_index
4141
mongoc_collection_create_index_with_opts
4242
mongoc_collection_create_indexes_with_opts
43-
mongoc_collection_delete
4443
mongoc_collection_delete_many
4544
mongoc_collection_delete_one
4645
mongoc_collection_destroy

src/libmongoc/doc/mongoc_delete_flags_t.rst

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

src/libmongoc/doc/mongoc_reply_flags_t.rst

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

src/libmongoc/src/mongoc/mongoc-collection.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,17 +2348,6 @@ mongoc_collection_remove (mongoc_collection_t *collection,
23482348
}
23492349

23502350

2351-
bool
2352-
mongoc_collection_delete (mongoc_collection_t *collection,
2353-
mongoc_delete_flags_t flags,
2354-
const bson_t *selector,
2355-
const mongoc_write_concern_t *write_concern,
2356-
bson_error_t *error)
2357-
{
2358-
return mongoc_collection_remove (collection, (mongoc_remove_flags_t) flags, selector, write_concern, error);
2359-
}
2360-
2361-
23622351
static bool
23632352
_mongoc_delete_one_or_many (mongoc_collection_t *collection,
23642353
bool multi,

src/libmongoc/src/mongoc/mongoc-collection.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,6 @@ mongoc_collection_replace_one (mongoc_collection_t *collection,
251251
bson_t *reply,
252252
bson_error_t *error);
253253

254-
BSON_DEPRECATED_FOR (mongoc_collection_delete_one or mongoc_collection_delete_many)
255-
MONGOC_EXPORT (bool) mongoc_collection_delete (mongoc_collection_t *collection,
256-
mongoc_delete_flags_t flags,
257-
const bson_t *selector,
258-
const mongoc_write_concern_t *write_concern,
259-
bson_error_t *error);
260-
261254
MONGOC_EXPORT (bool)
262255
mongoc_collection_remove (mongoc_collection_t *collection,
263256
mongoc_remove_flags_t flags,

src/libmongoc/src/mongoc/mongoc-flags.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ BSON_STATIC_ASSERT (MONGOC_OP_MSG_FLAG_CHECKSUM_PRESENT == MONGOC_MSG_CHECKSUM_P
3636
BSON_STATIC_ASSERT (MONGOC_OP_MSG_FLAG_MORE_TO_COME == MONGOC_MSG_MORE_TO_COME);
3737
BSON_STATIC_ASSERT (MONGOC_OP_MSG_FLAG_EXHAUST_ALLOWED == MONGOC_MSG_EXHAUST_ALLOWED);
3838

39-
BSON_STATIC_ASSERT (MONGOC_OP_REPLY_RESPONSE_FLAG_NONE == MONGOC_REPLY_NONE);
40-
BSON_STATIC_ASSERT (MONGOC_OP_REPLY_RESPONSE_FLAG_CURSOR_NOT_FOUND == MONGOC_REPLY_CURSOR_NOT_FOUND);
41-
BSON_STATIC_ASSERT (MONGOC_OP_REPLY_RESPONSE_FLAG_QUERY_FAILURE == MONGOC_REPLY_QUERY_FAILURE);
42-
BSON_STATIC_ASSERT (MONGOC_OP_REPLY_RESPONSE_FLAG_SHARD_CONFIG_STALE == MONGOC_REPLY_SHARD_CONFIG_STALE);
43-
BSON_STATIC_ASSERT (MONGOC_OP_REPLY_RESPONSE_FLAG_AWAIT_CAPABLE == MONGOC_REPLY_AWAIT_CAPABLE);
44-
4539
BSON_STATIC_ASSERT (MONGOC_OP_UPDATE_FLAG_NONE == MONGOC_UPDATE_NONE);
4640
BSON_STATIC_ASSERT (MONGOC_OP_UPDATE_FLAG_UPSERT == MONGOC_UPDATE_UPSERT);
4741
BSON_STATIC_ASSERT (MONGOC_OP_UPDATE_FLAG_MULTI_UPDATE == MONGOC_UPDATE_MULTI_UPDATE);
@@ -57,6 +51,3 @@ BSON_STATIC_ASSERT (MONGOC_OP_QUERY_FLAG_NO_CURSOR_TIMEOUT == MONGOC_QUERY_NO_CU
5751
BSON_STATIC_ASSERT (MONGOC_OP_QUERY_FLAG_AWAIT_DATA == MONGOC_QUERY_AWAIT_DATA);
5852
BSON_STATIC_ASSERT (MONGOC_OP_QUERY_FLAG_EXHAUST == MONGOC_QUERY_EXHAUST);
5953
BSON_STATIC_ASSERT (MONGOC_OP_QUERY_FLAG_PARTIAL == MONGOC_QUERY_PARTIAL);
60-
61-
BSON_STATIC_ASSERT (MONGOC_OP_DELETE_FLAG_NONE == MONGOC_DELETE_NONE);
62-
BSON_STATIC_ASSERT (MONGOC_OP_DELETE_FLAG_SINGLE_REMOVE == MONGOC_DELETE_SINGLE_REMOVE);

0 commit comments

Comments
 (0)