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

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

#include <document.hpp>

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

Public Member Functions

 document ()
 Default constructor.
 
bsoncxx::v_noabi::document::view view () const
 
 operator bsoncxx::v_noabi::document::view () const
 
bsoncxx::v_noabi::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::v_noabi::builder::stream::key_context<>
 key_context (core *core)
 Create a key_context given a core builder.
 
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.
 
detail::requires_t< key_context &, detail::is_invocable< T, key_context > > 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.
 
detail::requires_t< bsoncxx::v_noabi::document::value, std::is_same< base, closed_context >, detail::is_alike< T, finalize_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.

Note
Use of the stream builder is discouraged. See https://mongocxx.org/mongocxx-v3/working-with-bson/#stream-builder for more details.

Member Function Documentation

◆ extract()

bsoncxx::v_noabi::document::value bsoncxx::v_noabi::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::v_noabi::document::view()

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

◆ view()

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

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