1BSON_TYPE_T(3) libbson BSON_TYPE_T(3)
2
3
4
5BSON Type Enumeration
6
8 #include <bson/bson.h>
9
10 typedef enum {
11 BSON_TYPE_EOD = 0x00,
12 BSON_TYPE_DOUBLE = 0x01,
13 BSON_TYPE_UTF8 = 0x02,
14 BSON_TYPE_DOCUMENT = 0x03,
15 BSON_TYPE_ARRAY = 0x04,
16 BSON_TYPE_BINARY = 0x05,
17 BSON_TYPE_UNDEFINED = 0x06,
18 BSON_TYPE_OID = 0x07,
19 BSON_TYPE_BOOL = 0x08,
20 BSON_TYPE_DATE_TIME = 0x09,
21 BSON_TYPE_NULL = 0x0A,
22 BSON_TYPE_REGEX = 0x0B,
23 BSON_TYPE_DBPOINTER = 0x0C,
24 BSON_TYPE_CODE = 0x0D,
25 BSON_TYPE_SYMBOL = 0x0E,
26 BSON_TYPE_CODEWSCOPE = 0x0F,
27 BSON_TYPE_INT32 = 0x10,
28 BSON_TYPE_TIMESTAMP = 0x11,
29 BSON_TYPE_INT64 = 0x12,
30 BSON_TYPE_DECIMAL128 = 0x13,
31 BSON_TYPE_MAXKEY = 0x7F,
32 BSON_TYPE_MINKEY = 0xFF,
33 } bson_type_t;
34
36 The bson_type_t enumeration contains all of the types from the BSON
37 Specification. It can be used to determine the type of a field at run‐
38 time.
39
41 bson_iter_t iter;
42
43 if (bson_iter_init_find (&iter, doc, "foo") &&
44 (BSON_TYPE_INT32 == bson_iter_type (&iter))) {
45 printf ("'foo' is an int32.\n");
46 }
47
49 MongoDB, Inc
50
52 2017-present, MongoDB, Inc
53
54
55
56
571.25.1 Nov 08, 2023 BSON_TYPE_T(3)