MongoDB C++ Driver mongocxx-3.0.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bsoncxx::builder::stream::document Class Reference

A streaming interface for constructing a BSON document. More...

#include <document.hpp>

+ Inheritance diagram for bsoncxx::builder::stream::document:

Public Member Functions

 document ()
 Default constructor.
 
bsoncxx::document::view view () const
 
 operator bsoncxx::document::view () const
 
bsoncxx::document::value extract ()
 Transfer ownership of the underlying document to the caller.
 
void clear ()
 Reset the underlying BSON to an empty document.
 
- Public Member Functions inherited from bsoncxx::builder::stream::key_context< base >
 key_context (core *core)
 Create a key_context given a core builder.
 
template<std::size_t n>
value_context< key_contextoperator<< (const char(&v)[n])
 << operator for accepting a literal key and appending it to the core builder.
 
value_context< key_contextoperator<< (std::string str)
 << operator for accepting a std::string key and appending it to the core builder.
 
value_context< key_contextoperator<< (stdx::string_view str)
 << operator for accepting a stdx::string_view key and appending it to the core builder.
 
template<typename T >
std::enable_if< util::is_functor< T, void(key_context<>)>::value, key_context >::type & operator<< (T &&func)
 << operator for accepting a callable of the form void(key_context) and invoking it to perform 1 or more key, value appends to the core builder.
 
template<typename T >
std::enable_if< std::is_same< base, closed_context >::value &&std::is_same< typenamestd::remove_reference< T >::type, constfinalize_type >::value, bsoncxx::document::value >::type operator<< (T &&)
 << operator for finalizing the stream.
 
key_context operator<< (concatenate_doc doc)
 << operator for concatenating another document.
 
base operator<< (const close_document_type)
 << operator for closing a subdocument in the core builder.
 
 operator key_context ()
 Conversion operator which provides a rooted document given any stream currently in a nested key_context.
 

Detailed Description

A streaming interface for constructing a BSON document.

Member Function Documentation

◆ extract()

bsoncxx::document::value bsoncxx::builder::stream::document::extract ( )
inline

Transfer ownership of the underlying document to the caller.

Returns
A document::value with ownership of the document.
Warning
After calling extract() it is illegal to call any methods on this class, unless it is subsequenly moved into.

◆ operator bsoncxx::document::view()

bsoncxx::builder::stream::document::operator bsoncxx::document::view ( ) const
inline
Returns
A view of the BSON document.

◆ view()

bsoncxx::document::view bsoncxx::builder::stream::document::view ( ) const
inline
Returns
A view of the BSON document.

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