BSON_CONTEXT_NEW(3)

πŸ’… BSON_CONTEXT_NEW πŸ’…

ok so this is a page from libbson, section 3 (library functions, bestie, not a command you type). it's all about making a shiny new bson_context_t β€” yes that's the whole personality of this page, and honestly? iconic.


✨ SYNOPSIS ✨

bson_context_t *
bson_context_new (bson_context_flags_t flags);

like, one function, one argument, zero drama πŸŽ€


🌸 PARAMETERS 🌸

  • flags β€” a bson_context_flags_t. that's it, that's the vibe.

here are the flags you can actually use, fr fr:

  • BSON_CONTEXT_NONE β€” meaning creating ObjectIDs with this context is not a thread-safe operation 😭 (yes that's the default energy, be careful bestie)
  • BSON_CONTEXT_DISABLE_PID_CACHE β€” meaning creating ObjectIDs will also check if the process has changed by calling getpid() on every ObjectID generation. every single one. no caching, no shortcuts, we checkin' πŸ”₯

and these ones? deprecated, zero effect, they're giving ghost of flags past πŸ‘»:

  • BSON_CONTEXT_DISABLE_HOST_CACHE
  • BSON_CONTEXT_THREAD_SAFE
  • BSON_CONTEXT_USE_TASK_ID
lowkey if you're out here passing the deprecated ones, they will simply not do anything. not a vibe check failure, just... nothing. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

Creates a new bson_context_t. and here's the tea β€” this is rarely needed, because bson_context_get_default() serves most use-cases. so like, unless you have a real reason, the default one already ate and left no crumbs πŸ‘‘


🌈 RETURNS 🌈

A newly allocated bson_context_t that should be freed with bson_context_destroy().

not me reminding you to free it β€” please don't leak, bestie, that's not main character energy πŸ’…

πŸ’– AUTHOR πŸ’–

MongoDB, Inc β€” the ones who brought you this whole thing 🫢


2009-present, MongoDB, Inc.


and that's the whole page!! written by the libbson girlies, version 2.5.6, dated Oct 09, 2026 β€” see you in the next manpage, mwah πŸ§šπŸ’œ

πŸ“¦ where this page comes from