Loading...
Searching...
No Matches
bsoncxx::v_noabi::builder::basic Namespace Reference

## Description

Declares entities used with "basic" BSON builder syntax.

## Classes

class | array
| A traditional builder-style interface for constructing a BSON array. More...
class | document
| A traditional builder-style interface for constructing a BSON document. More...
class | sub_array
| Represents an array element being constructed during an append operation. More...
class | sub_binary
| Represents a BSON Binary element being constructed during an append operation. More...
class | sub_document
| Represents a document element being constructed during an append operation. More...

## Functions

concatenate_doc | concatenate (document::view_or_value doc)
| Helper method to concatenate a document.
template<typename T, typename U>
std::tuple< T &&, U && > | kvp (T &&t, U &&u)
| Constructs a key-value pair from a string key and a BSON value.
template<typename... Args>
v_noabi::array::value | make_array (Args &&... args)
| Creates an array from a list of elements.
template<typename... Args>
v_noabi::document::value | make_document (Args &&... args)
| Creates a document from a list of key-value pairs.

## Function Documentation

## concatenate()

concatenate_doc bsoncxx::v_noabi::builder::concatenate | ( | document::view_or_value | doc | ) |

inline

Helper method to concatenate a document.

Use this with a document builder to merge an existing document's fields with that of the document being built.

Parameters

  doc | The document to concatenate.

Returns
  concatenate_doc A concatenating struct.

See also
  - bsoncxx::v_noabi::builder::concatenate_doc

## kvp()

template<typename T, typename U>

std::tuple< T &&, U && > bsoncxx::v_noabi::builder::basic::kvp | ( | T && | t,
|  | U && | u )

Constructs a key-value pair from a string key and a BSON value.

## make_array()

template<typename... Args>

v_noabi::array::value bsoncxx::v_noabi::builder::basic::make_array | ( | Args &&... | args | ) |

Creates an array from a list of elements.

Parameters

  args | A variadiac list of elements. The types of the elements can be anything that builder::basic::sub_array::append accepts.

Returns
  A bsoncxx::v_noabi::array::value containing the elements.

## make_document()

template<typename... Args>

v_noabi::document::value bsoncxx::v_noabi::builder::basic::make_document | ( | Args &&... | args | ) |

Creates a document from a list of key-value pairs.

Parameters

  args | A variadic list of key-value pairs. The types of the keys and values can be anything that builder::basic::sub_document::append accepts.

Returns
  A bsoncxx::v_noabi::document::value containing the elements.