BSON support.
Classes | |
class | Binary |
BSON Binary. More... | |
class | BsonException |
Generic BSON-related exception. More... | |
class | BsonString |
class | ConversionException |
Conversion error. More... | |
class | Decimal128 |
BSON Decimal128. More... | |
class | Document |
BSON document. More... | |
class | ExceptionWithPath |
class | Iterator |
Iterator for BSON values. More... | |
class | JsonString |
class | MaxKey |
BSON MaxKey. More... | |
class | MemberMissingException |
BSON nonexisting member access error. More... | |
class | MinKey |
BSON MinKey. More... | |
class | Oid |
BSON ObjectId. More... | |
class | OutOfBoundsException |
BSON array indexing error. More... | |
class | ParseException |
BSON parsing error. More... | |
class | Timestamp |
BSON Timestamp. More... | |
class | TypeMismatchException |
BSON types mismatch error. More... | |
class | Value |
Non-mutable BSON value representation. More... | |
class | ValueBuilder |
Builder for BSON. More... | |
Functions | |
Document | FromBinaryString (std::string_view binary) |
Recovers a BSON document from its binary form. | |
BsonString | ToBinaryString (const formats::bson::Document &) |
Dumps a bson document to a binary string. | |
template<typename... Args> | |
Document | MakeDoc (Args &&...) |
Constructs a Document from provided key-value pairs. | |
template<typename... Args> | |
Value | MakeArray (Args &&...) |
Constructs an array Value from provided element list. | |
Document | FromJsonString (std::string_view json) |
Value | ArrayFromJsonString (std::string_view json) |
JsonString | ToCanonicalJsonString (const formats::bson::Document &) |
JsonString | ToRelaxedJsonString (const formats::bson::Document &) |
JsonString | ToLegacyJsonString (const formats::bson::Document &) |
JsonString | ToArrayJsonString (const formats::bson::Value &) |
std::ostream & | operator<< (std::ostream &, const JsonString &) |
logging::LogHelper & | operator<< (logging::LogHelper &, const JsonString &) |
logging::LogHelper & | operator<< (logging::LogHelper &, const Document &) |
Uses formats::bson::ToRelaxedJsonString representation by default. | |
Variables | |
constexpr auto | kNull = nullptr |
Value formats::bson::ArrayFromJsonString | ( | std::string_view | json | ) |
Applies heuristics to convert JSON string to BSON array. As JSON have rather lax typing, some heuristics are applied to guess correct BSON types for values. It is strongly recommended to write your own conversion routines matching your schemas.
Document formats::bson::FromJsonString | ( | std::string_view | json | ) |
Applies heuristics to convert JSON string to BSON document. As JSON have rather lax typing, some heuristics are applied to guess correct BSON types for values. It is strongly recommended to write your own conversion routines matching your schemas.
JsonString formats::bson::ToArrayJsonString | ( | const formats::bson::Value & | ) |
Converts BSON array to a legacy libbson's JSON format, except the outermost element is encoded as a JSON array, rather than a JSON document.
JsonString formats::bson::ToCanonicalJsonString | ( | const formats::bson::Document & | ) |
Converts BSON to a canonical MongoDB Extended JSON format.
JsonString formats::bson::ToLegacyJsonString | ( | const formats::bson::Document & | ) |
Converts BSON to a legacy libbson's JSON format. Notable differences from other formats:
JsonString formats::bson::ToRelaxedJsonString | ( | const formats::bson::Document & | ) |
Converts BSON to a relaxed MongoDB Extended JSON format. Notable differences from canonical format are:
$number*
objects;