Skip to content

Commit 0c41a35

Browse files
committed
CXX-175 no empty batches!
1 parent 62a0281 commit 0c41a35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mongo/client/bulk_operation_builder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ namespace mongo {
5454
}
5555

5656
void BulkOperationBuilder::execute(const WriteConcern* wc, std::vector<BSONObj>* results) {
57-
uassert(0, "Bulk operations cannot be executed twice", !_executed);
57+
uassert(0, "Bulk operations cannot be re-executed", !_executed);
58+
uassert(0, "Bulk operations cannot be executed without any operations",
59+
!_write_operations.empty());
5860

5961
if (!_ordered)
6062
std::sort(_write_operations.begin(), _write_operations.end(), compare);

0 commit comments

Comments
 (0)