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

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

#include <list.hpp>

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

Public Member Functions

 list ()
 Creates an empty document.
 
template<typename T >
 list (T value)
 Creates a bsoncxx::v_noabi::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::v_noabi::builder::list::list ( value)
inline

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

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

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

◆ list() [2/2]

bsoncxx::v_noabi::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::v_noabi::builder::document or bsoncxx::v_noabi::builder::array constructor, respectively.
See also
bsoncxx::v_noabi::builder::document
bsoncxx::v_noabi::builder::array

Member Function Documentation

◆ operator bson_value::view()

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

Provides a view of the underlying BSON value.

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

◆ view()

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

Provides a view of the underlying BSON value.

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

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