MongoDB C++ Driver  mongocxx-3.7.0
Public Member Functions | List of all members
bsoncxx::builder::list Class Reference

A JSON-like builder for creating documents and arrays. More...

#include <list.hpp>

+ Inheritance diagram for bsoncxx::builder::list:

Public Member Functions

 list ()
 Creates an empty document.
 
template<typename T >
 list (T value)
 Creates a bsoncxx::builder::list from a value of type T. More...
 
 list (initializer_list_t init)
 Creates a BSON document, if possible. More...
 
 operator bson_value::view ()
 Provides a view of the underlying BSON value. More...
 
bson_value::view view ()
 Provides a view of the underlying BSON value. More...
 

Detailed Description

A JSON-like builder for creating documents and arrays.

Constructor & Destructor Documentation

◆ list() [1/2]

template<typename T >
bsoncxx::builder::list::list ( value)
inline

Creates a bsoncxx::builder::list from a value of type T.

T must be a bsoncxx::types::bson_value::value or implicitly convertible to a bsoncxx::types::bson_value::value.

Parameters
valuethe BSON value
See also
bsoncxx::types::bson_value::value.

◆ list() [2/2]

bsoncxx::builder::list::list ( initializer_list_t  init)
inline

Creates a BSON document, if possible.

Otherwise, it will create a BSON array. A document is possible if:

Parameters
initthe initializer list used to construct the BSON document or array
Note
to enforce the creation of a BSON document or array use the bsoncxx::builder::document or bsoncxx::builder::array constructor, respectively.
See also
bsoncxx::builder::document
bsoncxx::builder::array

Member Function Documentation

◆ operator bson_value::view()

bsoncxx::builder::list::operator bson_value::view ( )
inline

Provides a view of the underlying BSON value.

See also
bsoncxx::types::bson_value::view.

◆ view()

bson_value::view bsoncxx::builder::list::view ( )
inline

Provides a view of the underlying BSON value.

See also
bsoncxx::types::bson_value::view.

The documentation for this class was generated from the following file: