bson_value_t (3) - Linux Manuals
bson_value_t: BSON Boxed Container Type
Command to display bson_value_t
manual in Linux: $ man 3 bson_value_t
NAME
bson_value_t - BSON Boxed Container Type
SYNOPSIS
#include <bson.h>
typedef struct _bson_value_t
{
bson_type_t value_type;
union {
bson_oid_t v_oid;
int64_t v_int64;
int32_t v_int32;
int8_t v_int8;
double v_double;
bool v_bool;
int64_t v_datetime;
struct {
uint32_t timestamp;
uint32_t increment;
} v_timestamp;
struct {
uint32_t len;
char *str;
} v_utf8;
struct {
uint32_t data_len;
uint8_t *data;
} v_doc;
struct {
uint32_t data_len;
uint8_t *data;
bson_subtype_t subtype;
} v_binary;
struct {
char *regex;
char *options;
} v_regex;
struct {
char *collection;
uint32_t collection_len;
bson_oid_t oid;
} v_dbpointer;
struct {
uint32_t code_len;
char *code;
} v_code;
struct {
uint32_t code_len;
char *code;
uint32_t scope_len;
uint8_t *scope_data;
} v_codewscope;
struct {
uint32_t len;
char *symbol;
} v_symbol;
} value;
} bson_value_t;
DESCRIPTION
The
bson_value_t
structure is a boxed type for encapsulating a runtime determined type.
EXAMPLE
const bson_value_t *value;
value = bson_iter_value (&iter);
if (value.type == BSON_TYPE_INT32) {
printf ("%d\n", value.value.v_int32);
}
COLOPHON
This page is part of libbson.
Please report any bugs at
https://jira.mongodb.org/browse/CDRIVER.
Pages related to bson_value_t
- bson_value_copy (3) - This function will copy the boxed content in src into dst. dst must be freed with bson_value_destroy() when no longer in use.
- bson_value_destroy (3) - Releases any resources associated with value.
- bson_validate (3) - Validates a BSON document by walking through the document and inspecting the fields for valid content.
- bson_visitor_t (3) - The bson_visitor_t structure provides a series of callbacks that can be called while iterating a BSON document. This may simplify the conversion of a bson_t to a higher level language structure.
- bson_vsnprintf (3) - Like bson_snprintf() but allows for variadic parameters.
- 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.