#include <BulkOperation.h>
Provides an abstraction for submitting multiple write operations as a single batch.
Definition at line 16 of file BulkOperation.h.
◆ BulkOperation() [1/4]
BulkOperation::BulkOperation |
( |
mongoc_bulk_operation_t * |
handle | ) |
|
|
explicit |
Default constructor. Note that the pointer is owned by this object afterwards, and it will take care of freeing its memory.
- Parameters
-
handle | a handle to the mongoc_bulk_operation_t pointer. |
Definition at line 11 of file BulkOperation.cpp.
mongoc_bulk_operation_t * handle_
◆ BulkOperation() [2/4]
knowrob::mongo::BulkOperation::BulkOperation |
( |
const BulkOperation & |
| ) |
|
|
delete |
◆ ~BulkOperation() [1/2]
BulkOperation::~BulkOperation |
( |
| ) |
|
◆ BulkOperation() [3/4]
knowrob::mongo::BulkOperation::BulkOperation |
( |
mongoc_bulk_operation_t * |
handle | ) |
|
|
explicit |
Default constructor. Note that the pointer is owned by this object afterwards, and it will take care of freeing its memory.
- Parameters
-
handle | a handle to the mongoc_bulk_operation_t pointer. |
◆ BulkOperation() [4/4]
knowrob::mongo::BulkOperation::BulkOperation |
( |
const BulkOperation & |
| ) |
|
|
delete |
◆ ~BulkOperation() [2/2]
knowrob::mongo::BulkOperation::~BulkOperation |
( |
| ) |
|
◆ empty() [1/2]
bool knowrob::mongo::BulkOperation::empty |
( |
| ) |
const |
|
inline |
- Returns
- true if this bulk operation is empty.
Definition at line 64 of file BulkOperation.h.
◆ empty() [2/2]
bool knowrob::mongo::BulkOperation::empty |
( |
| ) |
const |
|
inline |
- Returns
- true if this bulk operation is empty.
Definition at line 64 of file BulkOperation.h.
◆ execute() [1/2]
void BulkOperation::execute |
( |
| ) |
|
Execute this bulk operation. Note that a bulk operation can only be executed once.
Definition at line 91 of file BulkOperation.cpp.
94 bson_error_t bulk_err;
97 bool success = mongoc_bulk_operation_execute(
handle_, &bulk_reply, &bulk_err);
99 bson_destroy(&bulk_reply);
100 mongoc_bulk_operation_destroy(
handle_);
void validateBulkHandle()
◆ execute() [2/2]
void knowrob::mongo::BulkOperation::execute |
( |
| ) |
|
Execute this bulk operation. Note that a bulk operation can only be executed once.
◆ pushInsert() [1/2]
void BulkOperation::pushInsert |
( |
const bson_t * |
document | ) |
|
Add an insertion operation to this batch.
- Parameters
-
Definition at line 33 of file BulkOperation.cpp.
37 if (!mongoc_bulk_operation_insert_with_opts(
◆ pushInsert() [2/2]
void knowrob::mongo::BulkOperation::pushInsert |
( |
const bson_t * |
document | ) |
|
Add an insertion operation to this batch.
- Parameters
-
◆ pushRemoveAll() [1/2]
void BulkOperation::pushRemoveAll |
( |
const bson_t * |
document | ) |
|
Add a removal operation to this batch.
- Parameters
-
document | a document pattern. |
Definition at line 61 of file BulkOperation.cpp.
65 if (!mongoc_bulk_operation_remove_many_with_opts(
◆ pushRemoveAll() [2/2]
void knowrob::mongo::BulkOperation::pushRemoveAll |
( |
const bson_t * |
document | ) |
|
Add a removal operation to this batch.
- Parameters
-
document | a document pattern. |
◆ pushRemoveOne() [1/2]
void BulkOperation::pushRemoveOne |
( |
const bson_t * |
document | ) |
|
Add a removal operation to this batch.
- Parameters
-
document | a document pattern. |
Definition at line 47 of file BulkOperation.cpp.
51 if (!mongoc_bulk_operation_remove_one_with_opts(
◆ pushRemoveOne() [2/2]
void knowrob::mongo::BulkOperation::pushRemoveOne |
( |
const bson_t * |
document | ) |
|
Add a removal operation to this batch.
- Parameters
-
document | a document pattern. |
◆ pushUpdate() [1/2]
void BulkOperation::pushUpdate |
( |
bson_t * |
query, |
|
|
bson_t * |
update |
|
) |
| |
Add an update operation to this batch.
- Parameters
-
query | a document pattern. |
update | a update document. |
Definition at line 75 of file BulkOperation.cpp.
79 if (!mongoc_bulk_operation_update_many_with_opts(
◆ pushUpdate() [2/2]
void knowrob::mongo::BulkOperation::pushUpdate |
( |
bson_t * |
query, |
|
|
bson_t * |
update |
|
) |
| |
Add an update operation to this batch.
- Parameters
-
query | a document pattern. |
update | a update document. |
◆ validateBulkHandle() [1/2]
void BulkOperation::validateBulkHandle |
( |
| ) |
|
|
protected |
Definition at line 22 of file BulkOperation.cpp.
27 MONGOC_ERROR_COMMAND_INVALID_ARG,
28 "bulk operation can only be executed once");
◆ validateBulkHandle() [2/2]
void knowrob::mongo::BulkOperation::validateBulkHandle |
( |
| ) |
|
|
protected |
◆ empty_
bool knowrob::mongo::BulkOperation::empty_ = true |
|
protected |
◆ handle_
mongoc_bulk_operation_t * knowrob::mongo::BulkOperation::handle_ |
|
protected |
The documentation for this class was generated from the following files: