BSON_APPEND_MAXKEY(3)
π BSON_APPEND_MAXKEY(3) β like, the libbson glow-up guide β¨
okay bestie, buckle up π this is the BSON_APPEND_MAXKEY(3) page from the libbson manual, and honestly? it's short, it's sweet, and it absolutely ate. let's get into it π«Ά
β¨ SYNOPSIS β¨
here's the whole vibe, verbatim, no cap:
#define BSON_APPEND_MAXKEY(b, key) \
bson_append_maxkey (b, key, (int) strlen (key))
bool
bson_append_maxkey (bson_t *bson, const char *key, int key_length);
so you've got the cute lil macro that does the strlen() for you (main character energy fr), and the actual function underneath doing the real work πͺ
πΈ PARAMETERS πΈ
bsonβ abson_t. that's the document you're stuffing things into, bestie πkeyβ an ASCII C string holding the name of the field. like, the label on the box π·οΈkey_lengthβ how longkeyis, in bytes. OR you can pass-1and it'll figure out the length withstrlen()for you, which is lowkey iconic π
π¦ DESCRIPTION π¦
so bson_append_maxkey() shall append an element of type BSON_TYPE_MAXKEY to a bson document. that's it, that's the whole job π
but here's the tea β β this is primarily used in queries, and it's unlikely to be used when storing a document to MongoDB. so like, it's a query-time girly, not a storage-time girly. know the difference π
π₯ RETURNS π₯
returns true if the operation was applied successfully β slay β
but listen, she has limits: the function will fail if appending the value grows bson larger than INT32_MAX. that's the ceiling, bestie, and we do not cross it π«π
π AUTHOR π
MongoDB, Inc β yeah, them. the ones who made it π
π COPYRIGHT π
2009-present, MongoDB, Inc. β iconic run honestly, decade-plus and still going π
okay that's the whole page, you understood it perfectly, i'm so proud of you π₯Ήπ this was libbson 2.5.6, dated Oct 09, 2026 β write it down in your notes app bestie, and go append some maxkeys responsibly β¨π¦π
π¦ 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