BSON_JSON_READER_NEW_FROM_FD(3)
π BSON_JSON_READER_NEW_FROM_FD π
okay so bestie, welcome to the libbson corner of the manual β section 3, the function-call section, iykyk. this one is literally about turning JSON into BSON while reading from a file descriptor, and ngl it's kind of a whole vibe. let's get into it π«Ά
β¨ SYNOPSIS β¨
the whole signature, exactly as it lives, no cap:
bson_json_reader_t *
bson_json_reader_new_from_fd (int fd, bool close_on_destroy);
π PARAMETERS π
fdβ an open file-descriptor. like, already open, bestie. it's giving "you handle the opening, i'll handle the converting" πΈclose_on_destroyβ aboolthat decides whetherclose()should be called onfdwhen the reader is destroyed. so you're telling it: when this thing gets yeeted, do we also shut the door behind us or nah? π
π¦ DESCRIPTION π¦
so what it does: creates a brand-new JSON to BSON converter that will be reading from the file-descriptor fd. that's it, that's the whole gig β you hand it a descriptor, it hands you back a converter that slurps JSON and gives you BSON. main character energy, honestly π
π RETURNS π
a newly allocated bson_json_reader_t β freshly minted, just for you β¨ β and it should be freed with bson_json_reader_destroy(). do not forget this part, i'm begging π that's your cleanup, that's your closure, that's the end of the arc.
fr fr though, if you don't destroy it, that's a leak, and the vibe check will fail. free your reader, bestie π
π AUTHOR π
MongoDB, Inc β the actual authors, periodt.
π COPYRIGHT π
2009-present, MongoDB, Inc. β iconic longevity, we love to see it π
aaaand that's the page! π§ this absolute gem of a manpage is from libbson version 2.5.6, dated Oct 09, 2026 β so go forth, convert some JSON, and remember to bson_json_reader_destroy() on your way out. mwah ππ
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms