BSON Value Types#
- <bson/types.h> (header file)#
Defines a type enumeration for BSON value types, as well as several utility types for holding BSON values.
Types#
Type Enumeration#
-
enum [[zero_initializable]] bson_type#
This enumeration corresponds to the types of BSON elements. Their numeric value is equal to the octet value that is encoded in the BSON data itself.
-
enumerator bson_type_eod = 0x00#
-
enumerator bson_type_double = 0x01#
-
enumerator bson_type_utf8 = 0x02#
-
enumerator bson_type_document = 0x03#
-
enumerator bson_type_array = 0x04#
-
enumerator bson_type_binary = 0x05#
-
enumerator bson_type_undefined = 0x06#
-
enumerator bson_type_oid = 0x07#
-
enumerator bson_type_bool = 0x08#
-
enumerator bson_type_date_time = 0x09#
-
enumerator bson_type_null = 0x0A#
-
enumerator bson_type_regex = 0x0B#
-
enumerator bson_type_dbpointer = 0x0C#
-
enumerator bson_type_code = 0x0D#
-
enumerator bson_type_symbol = 0x0E#
-
enumerator bson_type_codewscope = 0x0F#
-
enumerator bson_type_int32 = 0x10#
-
enumerator bson_type_timestamp = 0x11#
-
enumerator bson_type_int64 = 0x12#
-
enumerator bson_type_decimal128 = 0x13#
-
enumerator bson_type_maxkey = 0x7F#
-
enumerator bson_type_minkey = 0xFF#
-
enumerator bson_type_eod = 0x00#
Element Value Types#
The following custom struct types are defined for decoding certain element values.
-
struct [[zero_initializable]] bson_eod#
-
struct [[zero_initializable]] bson_undefined#
-
struct [[zero_initializable]] bson_null#
-
struct [[zero_initializable]] bson_maxkey#
-
struct [[zero_initializable]] bson_minkey#
Empty struct types defined as placeholders for the BSON unit value types. The
bson_eod
struct is a special placeholder that represents the lack of value.
-
struct [[zero_initializable]] bson_binary_view#
-
struct [[zero_initializable]] bson_dbpointer_view#
-
mlib_str_view collection#
The collection name
-
mlib_str_view collection#
-
struct [[zero_initializable]] bson_regex_view#
-
mlib_str_view regex#
-
mlib_str_view options#
The regular expression string and options string.
-
mlib_str_view regex#
-
struct [[zero_initializable]] bson_symbol_view#
-
mlib_str_view utf8#
The symbol spelling string
-
mlib_str_view utf8#
-
struct [[zero_initializable]] bson_code_view#
-
mlib_str_view utf8#
The code string
-
mlib_str_view utf8#
-
struct [[zero_initializable]] bson_datetime#
-
using bson::null = ::bson_null#
-
using bson::undefined = ::bson_undefined#
-
using bson::minkey = ::bson_minkey#
-
using bson::maxkey = ::bson_maxkey#
Aliases of the C type within the
bson
namespace.