MongoDB C++ Driver  mongocxx-3.4.0
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. More...
 
void clear ()
 Reset the underlying BSON to an empty document.
 
- Public Member Functions inherited from bsoncxx::builder::stream::key_context<>
 key_context (core *core)
 Create a key_context given a core builder. More...
 
value_context< key_contextoperator<< (const char(&v)[n])
 << operator for accepting a literal key and appending it to the core builder. More...
 
value_context< key_contextoperator<< (std::string str)
 << operator for accepting a std::string key and appending it to the core builder. More...
 
value_context< key_contextoperator<< (stdx::string_view str)
 << operator for accepting a stdx::string_view key and appending it to the core builder. More...
 
std::enable_if< util::is_functor< T, void(key_context<>)>::value, key_context >::typeoperator<< (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. More...
 
std::enable_if< std::is_same< closed_context, closed_context >::value &&std::is_same< typename std::remove_reference< T >::type, const finalize_type >::value, bsoncxx::document::value >::type operator<< (T &&)
 << operator for finalizing the stream. More...
 
key_context operator<< (concatenate_doc doc)
 << operator for concatenating another document. More...
 
closed_context operator<< (const close_document_type)
 << operator for closing a subdocument in the core builder. More...
 
 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.

Note
Use of the stream builder is discouraged. See http://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/working-with-bson/#stream-builder for more details.

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: