MongoDB C++ Driver 4.2.0
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:

See also
Attention
This feature is experimental! It is not ready for use!

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.
resultoperator= (result &&other) noexcept
 Move assignment.
resultoperator= (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

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.

◆ 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: