BSON_APPEND_MINKEY(3)
π BSON_APPEND_MINKEY(3) β the libbson one, bestie β¨
okay so picture this: a whole manual page, but make it make sense. it's BSON_APPEND_MINKEY(3) from libbson, and honestly? it's a tiny little icon and we're gonna get into it π
β¨ SYNOPSIS β¨
like, here's the vibe, verbatim, no notes:
#define BSON_APPEND_MINKEY(b, key) \
bson_append_minkey (b, key, (int) strlen (key))
bool
bson_append_minkey (bson_t *bson, const char *key, int key_length);
so there's the macro shortcut π«Ά and there's the real function doing the actual work. two for the price of one, we love to see it.
πΈ PARAMETERS πΈ
bsonβ abson_t. that's the doc, the canvas, the main character πkeyβ an ASCII C string holding the name of the field. so like, ASCII only, bestie, don't try anything fancy πkey_lengthβ how many bytes longkeyis, or hit it with-1and let it figure the length out withstrlen(). convenient fr fr β¨
π¦ DESCRIPTION π¦
so bson_append_minkey() shall append an element of type BSON_TYPE_MINKEY to a bson document. that's the whole gig. no cap π
where does this actually get used though? primarily in queries. and β important β it's unlikely to be used when storing a document to MongoDB. so like, if you're out here stuffing minkeys into documents you're saving, that's giving wrong-tool-for-the-job energy, just so you know π
π RETURNS π
returns true if the operation was applied successfully π and the function will fail if appending the value grows bson larger than INT32_MAX. so watch the size, bestie, that's the line you do not cross π
β AUTHOR β
MongoDB, Inc β the whole squad π«Ά
π COPYRIGHT π
2009-present, MongoDB, Inc. β iconic, long-running, respect the legacy π
and that's the tea π this page was served up in version 2.5.6, dated Oct 09, 2026, under the libbson banner β love that for us, 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