BSON_ITER_CODEWSCOPE(3)
Okay so this is the BSON_ITER_CODEWSCOPE(3) page from libbson, and it's literally here to help you handle code-with-scope iterator stuff without losing your mind π
β¨ Bestie, this one is niche but iconic.
β¨ SYNOPSIS β¨
#define BSON_ITER_HOLDS_CODEWSCOPE(iter) \
(bson_iter_type ((iter)) == BSON_TYPE_CODEWSCOPE)
const char *
bson_iter_codewscope (const bson_iter_t *iter,
uint32_t *length,
uint32_t *scope_len,
const uint8_t **scope);
π PARAMETERS π
Here's the cast of characters, bestie π«Ά:
iterβ abson_iter_t. This is the iterator you're working with.lengthβ an optional location for the length of the resulting UTF-8 encoded string. Optional, so no pressure.scope_lenβ an optional location for the length ofscope.scopeβ an optional location to store the immutable raw scope BSON document. Immutable, so don't even think about editing it π
π¦ DESCRIPTION π¦
Okay so bson_iter_codewscope() acts similar to bson_iter_code(), except for BSON_TYPE_CODEWSCOPE elements. The way that it also will provide a pointer to the buffer for scope, which can be loaded into a bson_t using bson_init_static(). Slay.
π RETURNS π
An UTF-8 encoded string containing the JavaScript code. Do not modify it or free it β that's the rule, bestie π.
π AUTHOR π
Author: MongoDB, Inc
π COPYRIGHT π
Copyright: 2009-present, MongoDB, Inc.
Mwah π β source libbson, version 2.5.6, dated Oct 09, 2026. That's the whole vibe check. π«Ά
π¦ 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