MongoDB C++ Driver
mongocxx-3.0.2
|
Class to build an insert_many bulk write operation. More...
#include <insert_many_builder.hpp>
Public Member Functions | |
insert_many_builder (const options::insert &options) | |
Initializes a new builder for an insert_many bulk write operation. More... | |
void | operator() (const bsoncxx::document::view &doc) |
Appends a single insert to insert_many bulk write operation. More... | |
stdx::optional< result::insert_many > | insert (collection *col) const |
Executes the underlying insert_many bulk operation. More... | |
Class to build an insert_many bulk write operation.
This can be used on its own, or called through the helper mongocxx::collection::insert_many.
|
explicit |
Initializes a new builder for an insert_many bulk write operation.
options | The options for this insert_many. |
stdx::optional<result::insert_many> mongocxx::insert_many_builder::insert | ( | collection * | col | ) | const |
Executes the underlying insert_many bulk operation.
col | A pointer to the collection into which the documents will be inserted. |
void mongocxx::insert_many_builder::operator() | ( | const bsoncxx::document::view & | doc | ) |
Appends a single insert to insert_many bulk write operation.
The document is copied into the bulk operation completely, so there is no dependency between the life of the document and the insert_many bulk write operation itself.
doc | The next document to be added to the insert_many operation. |