BSON_SUBTYPE_T(3)
π
BSON_SUBTYPE_T(3) β like, the libbson manual page, bestie π
β¨ NAME β¨
Binary Field Subtype β no cap, that's literally what this whole page is about π¦
πΈ SYNOPSIS πΈ
okay so first thing, you gotta pull in the header:
#include <bson/bson.h>
and then boom, here's the enum in all its glory π
typedef enum {
BSON_SUBTYPE_BINARY = 0x00,
BSON_SUBTYPE_FUNCTION = 0x01,
BSON_SUBTYPE_BINARY_DEPRECATED = 0x02,
BSON_SUBTYPE_UUID_DEPRECATED = 0x03,
BSON_SUBTYPE_UUID = 0x04,
BSON_SUBTYPE_MD5 = 0x05,
BSON_SUBTYPE_COLUMN = 0x07,
BSON_SUBTYPE_SENSITIVE = 0x08,
BSON_SUBTYPE_VECTOR = 0x09,
BSON_SUBTYPE_USER = 0x80,
} bson_subtype_t;
ten subtypes, zero notes, we love to see it β¨
π DESCRIPTION π
so this enum is basically the little vibe-check tag for binary fields β it holds all the various subtypes that may be used in a binary field π₯
want the full lore? it's all over at http://bsonspec.org β go read it, fr fr π«Ά
π EXAMPLE π
here's the moment you've been waiting for, the actual code:
bson_t doc = BSON_INITIALIZER;
BSON_APPEND_BINARY (&doc, "binary", BSON_SUBTYPE_BINARY, data, data_len);
see how we just slid BSON_SUBTYPE_BINARY right in there? iconic. ate. periodt. π
π AUTHOR π
MongoDB, Inc β the ones who made it happen π«‘
β COPYRIGHT β
2009-present, MongoDB, Inc. π§
that's the whole page bestie, every single enum value accounted for, nothing skipped, iykyk π
alright that's a wrap π this was version 2.5.6, dated Oct 09, 2026, brought to you by the libbson girlies β mwah, go write some binary fields πππ¦
π¦ 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