BSON_JSON_READER_READ(3)
π
BSON_JSON_READER_READ β the libbson era π¦
okay so bestie, welcome to bson_json_reader_read from <rainbow>libbson</rainbow> β yes, that libbson, the manual section 3 one, we're literally in the big leagues now π
β¨ SYNOPSIS β¨
int
bson_json_reader_read (bson_json_reader_t *reader,
bson_t *bson,
bson_error_t *error);
like, that's the whole signature, no cap β three args, one int coming back at you π«Ά
π PARAMETERS π
readerβ abson_json_reader_t. this is your reader, the main character here π the one doing the actual reading, iykyk.bsonβ abson_t. this is where the doc lands. your destination. your little bson home πerrorβ abson_error_t. the vibe check container for anything that goes wrong π if something breaks, it gets tucked in here.
πΈ DESCRIPTION πΈ
so what does it do? it reads the next BSON document from the underlying JSON source. that's it, that's the whole thing. it's giving "one document at a time, bestie" β¨ literally pulling the next doc out of your JSON source and handing it to you π
no extra behaviors, no secret tricks β please don't invent lore that isn't in the manpage π
π ERRORS π
errors get propagated via the error parameter. yeah. that bson_error_t up in the parameters? that's the one. if something goes sideways, the info travels back through error β it's not silently ignored, it's very much telling you π’
β RETURNS β
the return value is doing numbers, and each one means something different, so pay attention:
1β successful AND data was read. slay, we got a doc π₯0β successful, but no data was read. everything's fine, there's just nothing there π€·ββοΈ no drama, no error.-1β there was an error π that's the bad one, that's when you go checkerror.
lowkey those three values are the whole personality of this function, don't mix 'em up bestie π
π AUTHOR π
MongoDB, Inc β yeah, them. iconic. periodt.
π COPYRIGHT π
2009-present, MongoDB, Inc. β all rights reserved, respectfully π
okay that's the whole page, you ate that π and fr fr, one last cute sign-off: this gorgeous little doc is from version 2.5.6, dated Oct 09, 2026 β save the date, bestie, BSON_JSON_READER_READ(3) is a whole moment ππ
π¦ 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