BSON_JSON_OPTS_T(3)
π BSON_JSON_OPTS_T(3) β the libbson girlies' guide to BSON β JSON encoding options β¨
okay so bestie, this is a libbson manpage, section 3, and it's literally all about "BSON to JSON encoding options" β like the little settings bag you hand over when you want your BSON turned into MongoDB Extended JSON. no cap, that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
first things first, pull in the header:
#include <bson/bson.h>
then meet the star of the show, she's opaque and mysterious:
typedef struct _bson_json_opts_t bson_json_opts_t;
and these two functions are her whole entourage π
bson_json_opts_t *
bson_json_opts_new (bson_json_mode_t mode, int32_t max_len);
void
bson_json_opts_destroy (bson_json_opts_t *opts);
π DESCRIPTION π
The bson_json_opts_t structure contains options for encoding BSON into MongoDB Extended JSON. that's it, that's her job, and she ate π₯
modeβ this member is abson_json_mode_tand it defines the encoding mode. iykyk, pick your mode, pick your destiny βmax_lenβ this member holds a maximum length for the resulting JSON string. Encoding will stop once the serialised string has reached this length. literally she will cut herself off mid-sentence at that length, so know what you're asking for π
and if you want the whole thing? the full BSON document, no limits, main character energy? use BSON_MAX_LEN_UNLIMITED. periodt π
π¦ SEE ALSO π¦
bson_as_json_with_opts()β go read it, she's the one who actually puts these options to work π
πΈ AUTHOR πΈ
MongoDB, Inc β icons only π
π COPYRIGHT π
2009-present, MongoDB, Inc. β respect the copyright bestie, it's giving longevity π
and that's the whole page, no notes π go forth and encode responsibly β¨
version 2.5.6, dated Oct 09, 2026 β that's the libbson energy, signing off, 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