Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 905fbda

Browse files
committedMar 17, 2025·
DOCSP-48492: Remove bson_as_json
1 parent 0460cf2 commit 905fbda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎source/includes/write/gridfs.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ main (void)
1616
mongoc_database_t *db = mongoc_client_get_database (client, "db");
1717

1818
bson_error_t error;
19-
if (!mongoc_gridfs_bucket_new (db, NULL, NULL, &error)) {
19+
mongoc_gridfs_bucket_t *bucket = mongoc_gridfs_bucket_new (db, NULL, NULL, &error);
20+
if (!bucket) {
2021
fprintf (stderr, "Failed to create bucket: %s\n", error.message);
2122
}
2223
// end-create-bucket
@@ -75,7 +76,7 @@ main (void)
7576
const bson_t *file_doc;
7677

7778
while (mongoc_cursor_next(cursor, &file_doc)) {
78-
char *json = bson_as_json(file_doc, NULL);
79+
char *json = bson_as_relaxed_extended_json(file_doc, NULL);
7980
printf("%s\n", json);
8081
bson_free(json);
8182
}

0 commit comments

Comments
 (0)
Please sign in to comment.