#include <userver/storages/mongo/write_result.hpp>
MongoDB write operation result.
Definition at line 17 of file write_result.hpp.
Public Member Functions | |
WriteResult ()=default | |
Creates an empty write result. | |
std::unordered_map< size_t, formats::bson::Value > | UpsertedIds () const |
Map of _id values of upserted documents by operation (document) index. | |
std::optional< formats::bson::Document > | FoundDocument () const |
The document returned by FindAnd* operation if any. | |
std::unordered_map< size_t, MongoError > | ServerErrors () const |
Map of server errors by operation (document) index. | |
std::vector< MongoError > | WriteConcernErrors () const |
Write concern errors. | |
Affected document counters | |
Valid only for acknowledged writes, i.e. non-zero write concern | |
size_t | InsertedCount () const |
size_t | MatchedCount () const |
size_t | ModifiedCount () const |
size_t | UpsertedCount () const |
size_t | DeletedCount () const |
std::unordered_map< size_t, MongoError > storages::mongo::WriteResult::ServerErrors | ( | ) | const |
Map of server errors by operation (document) index.
For example, storages::mongo::Collection::InsertMany() with storages::mongo::options::Unordered and storages::mongo::options::SuppressServerExceptions option would produce a WriteResult with WriteResult::ServerErrors() containing information about failed insertions.
std::vector< MongoError > storages::mongo::WriteResult::WriteConcernErrors | ( | ) | const |
Write concern errors.