#include <mongocxx/v1/client_bulk_write.hpp>
A list of bulk write operations. Unlike mongocxx::v1::bulk_write, this supports writes across more than one collection and can group inserts, updates, and deletes in the same network payload.
- Note
- mongocxx::v1::client_bulk_write uses the bulkWrite server command. The bulkWrite command is only available on MongoDB servers 8.0 and newer.
- See also
-
|
| | client_bulk_write (client_bulk_write &&other) noexcept |
| | Move constructor.
|
| | client_bulk_write (client_bulk_write const &other)=delete |
| | This class is not copyable.
|
| | ~client_bulk_write () |
| | Destroy this object.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view document, insert_one_options const &opts) |
| | Append an "Insert One" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, bsoncxx::v1::document::view replacement, replace_one_options const &opts) |
| | Append a "Replace One" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, bsoncxx::v1::document::view update, update_many_options const &opts) |
| | Append an "Update Many" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, bsoncxx::v1::document::view update, update_one_options const &opts) |
| | Append an "Update One" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, delete_many_options const &opts) |
| | Append a "Delete Many" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, delete_one_options const &opts) |
| | Append a "Delete One" operation targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, v1::pipeline const &update, update_many_options const &opts) |
| | Append an "Update Many" operation with an aggregation pipeline targeting the given namespace.
|
| client_bulk_write & | append (bsoncxx::v1::stdx::string_view ns, bsoncxx::v1::document::view filter, v1::pipeline const &update, update_one_options const &opts) |
| | Append an "Update One" operation with an aggregation pipeline targeting the given namespace.
|
| bsoncxx::v1::stdx::optional< result > | execute (options const &opts) |
| | Execute the appended operations.
|
| client_bulk_write & | operator= (client_bulk_write &&other) noexcept |
| | Move assignment.
|
| client_bulk_write & | operator= (client_bulk_write const &other)=delete |
| | This class is not copyable.
|
◆ ~client_bulk_write()
| mongocxx::v1::client_bulk_write::~client_bulk_write |
( |
| ) |
|
◆ client_bulk_write() [1/2]
| mongocxx::v1::client_bulk_write::client_bulk_write |
( |
client_bulk_write && | other | ) |
|
|
noexcept |
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ client_bulk_write() [2/2]
| mongocxx::v1::client_bulk_write::client_bulk_write |
( |
client_bulk_write const & | other | ) |
|
|
delete |
This class is not copyable.
◆ append() [1/8]
Append an "Insert One" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [2/8]
Append a "Replace One" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [3/8]
Append an "Update Many" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [4/8]
Append an "Update One" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [5/8]
Append a "Delete Many" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [6/8]
Append a "Delete One" operation targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [7/8]
Append an "Update Many" operation with an aggregation pipeline targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ append() [8/8]
Append an "Update One" operation with an aggregation pipeline targeting the given namespace.
- Exceptions
-
| mongocxx::v1::exception | when a client-side error is encountered. |
◆ execute()
Execute the appended operations.
- Returns
- Empty when the bulk write operation is unacknowledged.
- Exceptions
-
| mongocxx::v1::client_bulk_write::exception | when a bulk write error is encountered. |
| mongocxx::v1::exception | for all other runtime errors. |
◆ operator=() [1/2]
Move assignment.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ operator=() [2/2]
This class is not copyable.
The documentation for this class was generated from the following file: