summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-07-10 16:52:49 -0400
committerMathias Stearn <mathias@10gen.com>2017-07-26 15:13:34 -0400
commitc731446ad3cc399d33b5b2cb28e5b776580f1beb (patch)
tree13be492fa9b16ed3d9e296d4d42e9fa2598cfad4 /src/mongo/db/pipeline
parent191931c4390ab1ede373e6772aa4d3999518fdaf (diff)
downloadmongo-c731446ad3cc399d33b5b2cb28e5b776580f1beb.tar.gz
SERVER-28509 Make DBClient use write commands
Everything that needs to actually use legacy write ops now does so explicitly.
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source_out.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_out.cpp b/src/mongo/db/pipeline/document_source_out.cpp
index 5eb3d8b4b51..3ac28ba4f62 100644
--- a/src/mongo/db/pipeline/document_source_out.cpp
+++ b/src/mongo/db/pipeline/document_source_out.cpp
@@ -30,6 +30,7 @@
#include "mongo/db/pipeline/document_source_out.h"
+#include "mongo/db/ops/write_ops.h"
#include "mongo/stdx/memory.h"
#include "mongo/util/destructor_guard.h"
@@ -169,7 +170,8 @@ DocumentSource::GetNextResult DocumentSourceOut::getNext() {
BSONObj toInsert = nextInput.releaseDocument().toBson();
bufferedBytes += toInsert.objsize();
- if (!bufferedObjects.empty() && bufferedBytes > BSONObjMaxUserSize) {
+ if (!bufferedObjects.empty() && (bufferedBytes > BSONObjMaxUserSize ||
+ bufferedObjects.size() >= write_ops::kMaxWriteBatchSize)) {
spill(bufferedObjects);
bufferedObjects.clear();
bufferedBytes = toInsert.objsize();