BSON_ITER_KEY(3)
π BSON_ITER_KEY π
okay bestie so you're out here iterating over BSON and you need the name of the thing your iterator is currently perched on β that's this function, and it's from libbson, the bson_iter_key (3) page. welcome, you're gonna love it here π«Ά
β¨ SYNOPSIS β¨
const char *
bson_iter_key (const bson_iter_t *iter);
one function, two lines, zero drama. she's iconic like that. π
πΈ PARAMETERS πΈ
iterβ Abson_iter_t. that's it. that's the whole parameter list, she's low maintenance. π
π¦ DESCRIPTION π¦
so basically this is the glow-up moment where you go "okay but WHAT is the key" β bson_iter_key() fetches the key for the current element observed by iter. that's the whole vibe. the element you're sitting on right now? this gives you its key. no cap, that's the entire job. β¨
β RETURNS β
it hands you back a string. a const char * string. and hiii quick PSA: this string should not be modified or freed β it's not yours, don't touch it, don't free() it, don't write into it. hands off the merch, bestie. ππ
SEE ALSO: bson_iter_key_len() β use her when you want the length of the key in constant time. like, you don't have to walk the whole string to find the end, she just knows. obsessed. β‘
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay that's the whole page, you're welcome, go slay your BSON parsing π₯
β¨ libbson version 2.5.6 β dated Oct 09, 2026 β¨ β mwah, bye bestie ππ
π¦ 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