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

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

## Description

The result of a write operation.

Supported fields include:

- inserted_count ("insertedCount")
- matched_count ("matchedCount")
- modified_count ("modifiedCount")
- deleted_count ("deletedCount")
- upserted_count ("upsertedCount")
- upserted_ids ("upsertedIds")

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

## Public Types

using | id_map = std::map<std::int64_t, bsoncxx::v1::types::view>
| A map from the operation index to the upserted document ID.

## Public Member Functions

| result (result &&other) noexcept
| Move constructor.
| result (result const &other)
| Copy construction.
| ~result ()
| Destroy this object.
std::int64_t | deleted_count () const
| Return the value of the "deletedCount" field.
std::int64_t | inserted_count () const
| Return the value of the "insertedCount" field.
std::int64_t | matched_count () const
| Return the value of the "matchedCount" field.
std::int64_t | modified_count () const
| Return the value of the "modifiedCount" field.
result & | operator= (result &&other) noexcept
| Move assignment.
result & | operator= (result const &other)
| Copy assignment.
std::int64_t | upserted_count () const
| Return the value of the "upsertedCount" field.
id_map | upserted_ids () const
| Return the "upsertedIds" field as a a map from the operation index to the upserted document ID.

## Friends

bool | operator== (result const &lhs, result const &rhs)
| Compare equal when all supported fields compare equal.
bool | operator!= (result const &lhs, result const &rhs)
| Compare equal when all supported fields compare equal.

## Member Typedef Documentation

## id_map

using mongocxx::v1::bulk_write::result::id_map = std::map<std::int64_t, bsoncxx::v1::types::view>

A map from the operation index to the upserted document ID.

## Constructor & Destructor Documentation

## ~result()

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

Destroy this object.

Warning
  Invalidates all associated views.

## result() [1/2]

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

noexcept

Move constructor.

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

## result() [2/2]

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

Copy construction.

## Member Function Documentation

## deleted_count()

std::int64_t mongocxx::v1::bulk_write::result::deleted_count | ( |  | ) | const

Return the value of the "deletedCount" field.

## inserted_count()

std::int64_t mongocxx::v1::bulk_write::result::inserted_count | ( |  | ) | const

Return the value of the "insertedCount" field.

## matched_count()

std::int64_t mongocxx::v1::bulk_write::result::matched_count | ( |  | ) | const

Return the value of the "matchedCount" field.

## modified_count()

std::int64_t mongocxx::v1::bulk_write::result::modified_count | ( |  | ) | const

Return the value of the "modifiedCount" field.

## operator=() [1/2]

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

noexcept

Move assignment.

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

## operator=() [2/2]

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

Copy assignment.

## upserted_count()

std::int64_t mongocxx::v1::bulk_write::result::upserted_count | ( |  | ) | const

Return the value of the "upsertedCount" field.

## upserted_ids()

id_map mongocxx::v1::bulk_write::result::upserted_ids | ( |  | ) | const

Return the "upsertedIds" field as a a map from the operation index to the upserted document ID.

Returns
  Empty when the "upsertedIds" field is not present or is empty.

## Friends And Related Symbol Documentation

## operator!=

bool operator!= | ( | result const & | lhs,
|  | result const & | rhs )

friend

Compare equal when all supported fields compare equal.

## operator==

bool operator== | ( | result const & | lhs,
|  | result const & | rhs )

friend

Compare equal when all supported fields compare equal.

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

- mongocxx/v1/bulk_write.hpp