Loading...
Searching...
No Matches
mongocxx::v1::bulk_write Class Reference

`#include <mongocxx/v1/bulk_write.hpp>`

## Description

A list of bulk write operations.

See also
  - Bulk Write Operations (MongoDB Manual)
  - Update Methods (MongoDB Manual)

## Classes

class | delete_many
| A single "Delete Many" write operation. More...
class | delete_one
| A single "Delete One" write operation. More...
class | insert_one
| A single "Insert One" write operation. More...
class | options
| Options for a bulk write operation. More...
class | replace_one
| A single "Replace One" write operation. More...
class | result
| The result of a write operation. More...
class | single
| A single write operation. More...
class | update_many
| A single "Update Many" write operation. More...
class | update_one
| A single "Update One" write operation. More...

## Public Types

enum class | type
| Enumeration identifying the type of a write operation. More...

## Public Member Functions

| bulk_write (bulk_write &&other) noexcept
| Move constructor.
| bulk_write (bulk_write const &other)=delete
| This class is not copyable.
| ~bulk_write ()
| Destroy this object.
bulk_write & | append (single const &op)
| Append a single write operation.
bool | empty () const
| Return true when there are no appended operations.
bsoncxx::v1::stdx::optional< result > | execute ()
| Execute the appended operations.
bulk_write & | operator= (bulk_write &&other) noexcept
| Move assignment.
bulk_write & | operator= (bulk_write const &other)=delete
| This class is not copyable.

## Member Enumeration Documentation

## type

enum class mongocxx::v1::bulk_write::type

strong

Enumeration identifying the type of a write operation.

Enumerator
k_insert_one | An "Insert One" operation.
k_delete_one | A "Delete One" operation.
k_delete_many | A "Delete Many" operation.
k_update_one | An "Update One" operation.
k_update_many | An "Update Many" operation.
k_replace_one | A "Replace One" operation.

## Constructor & Destructor Documentation

## ~bulk_write()

mongocxx::v1::bulk_write::~bulk_write | ( |  | ) |

Destroy this object.

## bulk_write() [1/2]

mongocxx::v1::bulk_write::bulk_write | ( | bulk_write && | other | ) |

noexcept

Move constructor.

Postconditions:
  - other is in an assign-or-destroy-only state.

## bulk_write() [2/2]

mongocxx::v1::bulk_write::bulk_write | ( | bulk_write const & | other | ) |

delete

This class is not copyable.

## Member Function Documentation

## append()

bulk_write & mongocxx::v1::bulk_write::append | ( | single const & | op | ) |

Append a single write operation.

Exceptions

  mongocxx::v1::exception | when a client-side error is encountered.

## empty()

bool mongocxx::v1::bulk_write::empty | ( |  | ) | const

Return true when there are no appended operations.

## execute()

bsoncxx::v1::stdx::optional< result > mongocxx::v1::bulk_write::execute | ( |  | ) |

Execute the appended operations.

Returns
  Empty when the bulk write operation is unacknowledged.

Exceptions

  mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available.
  mongocxx::v1::exception | for all other runtime errors.

## operator=() [1/2]

bulk_write & mongocxx::v1::bulk_write::operator= | ( | bulk_write && | other | ) |

noexcept

Move assignment.

Postconditions:
  - other is in an assign-or-destroy-only state.

## operator=() [2/2]

bulk_write & mongocxx::v1::bulk_write::operator= | ( | bulk_write const & | other | ) |

delete

This class is not copyable.

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

- mongocxx/v1/bulk_write.hpp