File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2554,7 +2554,7 @@ test_example_change_stream (mongoc_database_t *db)
2554
2554
bson_t opts = BSON_INITIALIZER ;
2555
2555
mongoc_change_stream_t * stream ;
2556
2556
const bson_t * change ;
2557
- bson_iter_t iter ;
2557
+ const bson_t * resume_token = bson_new () ;
2558
2558
bson_error_t error ;
2559
2559
2560
2560
collection = mongoc_database_get_collection (db , "inventory" );
@@ -2583,8 +2583,8 @@ test_example_change_stream (mongoc_database_t *db)
2583
2583
/* Start Changestream Example 3 */
2584
2584
stream = mongoc_collection_watch (collection , pipeline , NULL );
2585
2585
if (mongoc_change_stream_next (stream , & change )) {
2586
- bson_iter_init_find ( & iter , change , "_id" );
2587
- BSON_APPEND_VALUE (& opts , "resumeAfter" , bson_iter_value ( & iter ) );
2586
+ resume_token = mongoc_change_stream_get_resume_token ( stream );
2587
+ BSON_APPEND_DOCUMENT (& opts , "resumeAfter" , resume_token );
2588
2588
2589
2589
mongoc_change_stream_destroy (stream );
2590
2590
stream = mongoc_collection_watch (collection , pipeline , & opts );
You can’t perform that action at this time.
0 commit comments