Skip to content

Commit 2846383

Browse files
authored
CDRIVER-2604 remove mongoc_cursor_is_alive (#1916)
1 parent 846c115 commit 2846383

File tree

6 files changed

+2
-52
lines changed

6 files changed

+2
-52
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_cursor_is_alive` is removed. Use the equivalent `mongoc_cursor_more` instead.
2021
* `mongoc_collection_delete` is removed. Use `mongoc_collection_delete_one` or `mongoc_collection_delete_many` instead.
2122
* `mongoc_delete_flags_t` and `mongoc_reply_flags_t` are removed.
2223

src/libmongoc/doc/mongoc_cursor_is_alive.rst

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

src/libmongoc/doc/mongoc_cursor_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Example
5757
mongoc_cursor_get_id
5858
mongoc_cursor_get_limit
5959
mongoc_cursor_get_max_await_time_ms
60-
mongoc_cursor_is_alive
6160
mongoc_cursor_more
6261
mongoc_cursor_new_from_command_reply
6362
mongoc_cursor_new_from_command_reply_with_opts

src/libmongoc/src/mongoc/mongoc-cursor.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,23 +1421,6 @@ mongoc_cursor_clone (const mongoc_cursor_t *cursor)
14211421
}
14221422

14231423

1424-
/*
1425-
*--------------------------------------------------------------------------
1426-
*
1427-
* mongoc_cursor_is_alive --
1428-
*
1429-
* Deprecated for mongoc_cursor_more.
1430-
*
1431-
*--------------------------------------------------------------------------
1432-
*/
1433-
1434-
bool
1435-
mongoc_cursor_is_alive (const mongoc_cursor_t *cursor) /* IN */
1436-
{
1437-
return mongoc_cursor_more ((mongoc_cursor_t *) cursor);
1438-
}
1439-
1440-
14411424
const bson_t *
14421425
mongoc_cursor_current (const mongoc_cursor_t *cursor) /* IN */
14431426
{

src/libmongoc/src/mongoc/mongoc-cursor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ mongoc_cursor_error_document (mongoc_cursor_t *cursor, bson_error_t *error, cons
5555
MONGOC_EXPORT (void)
5656
mongoc_cursor_get_host (mongoc_cursor_t *cursor, mongoc_host_list_t *host);
5757

58-
BSON_DEPRECATED_FOR (mongoc_cursor_more) MONGOC_EXPORT (bool) mongoc_cursor_is_alive (const mongoc_cursor_t *cursor);
59-
6058
MONGOC_EXPORT (const bson_t *)
6159
mongoc_cursor_current (const mongoc_cursor_t *cursor);
6260

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,8 +2212,7 @@ test_error_document_getmore (void)
22122212
}
22132213

22142214
/* test that an error during constructing a find cursor causes the cursor to
2215-
* be marked as failed, so mongoc_cursor_is_alive and mongoc_cursor_more return
2216-
* false */
2215+
* be marked as failed, mongoc_cursor_more returns false */
22172216
static void
22182217
test_find_error_is_alive (void)
22192218
{
@@ -2229,7 +2228,6 @@ test_find_error_is_alive (void)
22292228
BSON_ASSERT (mongoc_cursor_error (cursor, &err));
22302229
ASSERT_ERROR_CONTAINS (
22312230
err, MONGOC_ERROR_CURSOR, MONGOC_ERROR_CURSOR_INVALID_CURSOR, "Cannot mix $query with non-dollar field");
2232-
BSON_ASSERT (!mongoc_cursor_is_alive (cursor));
22332231
BSON_ASSERT (!mongoc_cursor_more (cursor));
22342232
BSON_ASSERT (!mongoc_cursor_next (cursor, &bson));
22352233
mongoc_cursor_destroy (cursor);

0 commit comments

Comments
 (0)