20#include "mongo/client/export_macros.h"
21#include "mongo/util/net/operation.h"
143 void _mergeCommandResult(
const std::vector<WriteOperation*>& ops,
const BSONObj& result);
144 void _mergeGleResult(
const std::vector<WriteOperation*>& ops,
const BSONObj& result);
146 void _check(
bool throwSoftErrors);
147 void _setModified(
const BSONObj& result);
148 int _getIntOrDefault(
const BSONObj& obj,
const StringData& field,
const int defaultValue = 0);
150 int _createUpserts(
const BSONElement& upsert,
const std::vector<WriteOperation*>& ops);
151 void _createUpsert(
const BSONElement& upsert,
const std::vector<WriteOperation*>& ops);
152 void _createWriteError(
const BSONObj& error,
const std::vector<WriteOperation*>& ops);
153 void _createWriteConcernError(
const BSONObj& error);
161 std::vector<BSONObj> _upserted;
162 std::vector<BSONObj> _writeErrors;
163 std::vector<BSONObj> _writeConcernErrors;
165 bool _hasModifiedCount;
166 bool _requiresDetailedInsertResults;
BSONElement represents an "element" in a BSONObj.
Definition bsonelement.h:55
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
Class for constructing and executing bulk operations against MongoDB via a fluent API.
Definition bulk_operation_builder.h:54
Definition command_writer.h:24
Definition wire_protocol_writer.h:24
Class representing the result of a write operations sent to the server.
Definition write_result.h:33
int nUpserted() const
The number of documents that were upserted.
WriteResult()
Creates an empty write result.
bool hasWriteConcernErrors() const
Returns true if there have been write concern errors.
const std::vector< BSONObj > & writeConcernErrors() const
Vector with the write concern errors that occurred.
int nMatched() const
The number of documents that were matched.
int nModified() const
The number of documents that were modified.
bool hasErrors() const
Returns true if there have been write errors of any kind.
int nRemoved() const
The number of documents that were removed.
bool hasWriteErrors() const
Returns true if there have been write errors.
const std::vector< BSONObj > & upserted() const
The information about documents that were upserted.
bool hasModifiedCount() const
Returns true if the number of modified documents is available.
int nInserted() const
The number of documents that were inserted.
const std::vector< BSONObj > & writeErrors() const
Vector with the write errors that occurred.
the main MongoDB namespace
Definition bulk_operation_builder.h:24