bson_type_t (3) - Linux Manuals
bson_type_t: BSON Type Enumeration
Command to display bson_type_t
manual in Linux: $ man 3 bson_type_t
NAME
bson_type_t - BSON Type Enumeration
SYNOPSIS
#include <bson.h>
typedef enum
{
BSON_TYPE_EOD = 0x00,
BSON_TYPE_DOUBLE = 0x01,
BSON_TYPE_UTF8 = 0x02,
BSON_TYPE_DOCUMENT = 0x03,
BSON_TYPE_ARRAY = 0x04,
BSON_TYPE_BINARY = 0x05,
BSON_TYPE_UNDEFINED = 0x06,
BSON_TYPE_OID = 0x07,
BSON_TYPE_BOOL = 0x08,
BSON_TYPE_DATE_TIME = 0x09,
BSON_TYPE_NULL = 0x0A,
BSON_TYPE_REGEX = 0x0B,
BSON_TYPE_DBPOINTER = 0x0C,
BSON_TYPE_CODE = 0x0D,
BSON_TYPE_SYMBOL = 0x0E,
BSON_TYPE_CODEWSCOPE = 0x0F,
BSON_TYPE_INT32 = 0x10,
BSON_TYPE_TIMESTAMP = 0x11,
BSON_TYPE_INT64 = 0x12,
BSON_TYPE_MAXKEY = 0x7F,
BSON_TYPE_MINKEY = 0xFF,
} bson_type_t;
DESCRIPTION
The
bson_type_t
enumeration contains all of the types from the
BSON Specification
\&. It can be used to determine the type of a field at runtime.
EXAMPLE
bson_iter_t iter;
if (bson_iter_init_find (&iter, doc, "foo") &&
(BSON_TYPE_INT32 == bson_iter_type (&iter))) {
printf ("'foo' is an int32.\n");
}
COLOPHON
This page is part of libbson.
Please report any bugs at
https://jira.mongodb.org/browse/CDRIVER.
Pages related to bson_type_t
- bson_t (3) - BSON Document Abstraction
- bson_append_array (3) - The bson_append_array() function shall append child to bson using the specified key. The type of the field will be an array, but it is the responsibility of the caller to ensure that the keys of child are properly formatted with string keys such as "0", "1", "2" and so forth.
- bson_append_array_begin (3) - The bson_append_array_begin() function shall begin appending an array field to bson. This allows for incrementally building a sub-array. Doing so will generally yield better performance as you will serialize to a single buffer. When done building the sub-array, the caller MUST call bson_append_array_end().
- bson_append_array_end (3) - The bson_append_array_end() function shall complete the appending of an array field started with bson_append_array_begin(). child is invalid after calling this function.
- bson_append_binary (3) - The bson_append_binary() function shall append a new element to bson containing the binary data provided.
- bson_append_bool (3) - The bson_append_bool() function shall append a new element to bson containing the boolean provided.
- bson_append_code (3) - The bson_append_code() function shall append a new element to bson using the UTF-8 encoded javascript provided. javascript must be a NULL terminated C string.
- bson_append_code_with_scope (3) - The bson_append_code_with_scope() function shall perform like bson_append_code() except it allows providing a scope to the javascript function in the form of a bson document.
- bson_append_date_time (3) - The bson_append_date_time() function shall append a new element to a bson document containing a date and time with no timezone information. value is assumed to be in UTC format of milliseconds since the UNIX epoch. value MAY be negative.