Skip to content

Commit 823c905

Browse files
committed
Don't require saveResultAsEntity for createFindCursor operation
1 parent 6a9966b commit 823c905

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libmongoc/tests/unified/operation.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -724,10 +724,13 @@ operation_create_find_cursor (test_t *test,
724724
cursor = mongoc_collection_find_with_opts (
725725
coll, filter, opts, NULL /* read prefs */);
726726

727+
ret = true;
728+
729+
mongoc_cursor_error_document (cursor, &op_error, &op_reply);
730+
result_from_val_and_reply (result, NULL, (bson_t *) op_reply, &op_error);
727731

728732
if (!op->save_result_as_entity) {
729-
test_set_error (error,
730-
"unexpected createFindCursor does not save result");
733+
mongoc_cursor_destroy (cursor);
731734
goto done;
732735
}
733736

@@ -736,10 +739,6 @@ operation_create_find_cursor (test_t *test,
736739
goto done;
737740
}
738741

739-
mongoc_cursor_error_document (cursor, &op_error, &op_reply);
740-
result_from_val_and_reply (result, NULL, (bson_t *) op_reply, &op_error);
741-
742-
ret = true;
743742
done:
744743
bson_parser_destroy_with_parsed_fields (parser);
745744
bson_destroy (opts);

0 commit comments

Comments
 (0)