BSON_OID_INIT_SEQUENCE(3)
π BSON_OID_INIT_SEQUENCE π
okay so bestie, we're in the libbson section of the manual, page BSON_OID_INIT_SEQUENCE(3), and I need you to sit down for this one because she's deprecated π«Ά
π¨ WARNING π¨
Deprecated since version 1.14.0: Use bson_oid_init() instead.
not me having to tell you your fave is deprecated π she served her time, she ate, but the girlies have moved on. please use bson_oid_init() instead, no cap.
β¨ SYNOPSIS β¨
void
bson_oid_init_sequence (bson_oid_t *oid, bson_context_t *context);
that's it. that's the whole vibe check. π
π PARAMETERS π
oidβ Abson_oid_t. this is the little cutie getting the glow-up, the main character of the operation πcontextβ An optionalbson_context_t. optional!! she can be there or she can be unbothered, your call πΈ
π DESCRIPTION π
So what does she actually do?? She generates a brand new ObjectID using the next 64-bit sequence number in context. π¦
And the way she's built is so specific, like she's giving very structured:
- the first 4 bytes contain the current time β°
- the following 8 bytes contain the sequence number in big-endian format (iykyk) π₯
now here's the part you gotta hear, bestie, because it's lowkey important:
The bson_oid_t generated by this function is not guaranteed to be globally unique. She's only unique within this context. Periodt. π
BUT β and this is the slay β she is guaranteed to be sequential. So like, not one-of-a-kind in the whole universe, but definitely in order. iconic behavior honestly β¨
π AUTHOR π
MongoDB, Inc β the founders, the blueprint, the moment π
πΈ COPYRIGHT πΈ
2009-present, MongoDB, Inc.
okay bestie that's the whole page, mwah π this was page BSON_OID_INIT_SEQUENCE(3) from libbson, version 1.30.13, dated Oct 09, 2026 β and remember: she's deprecated, so go love on bson_oid_init() instead π«Άβ¨ bye bye!! π
π¦ where this page comes from
- fedora 43: libbson-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- fedora 43: libbson-devel 1.30.13-1.fc43 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms