aromanenko-dev commented on a change in pull request #14927:
URL: https://github.com/apache/beam/pull/14927#discussion_r668703561



##########
File path: 
sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java
##########
@@ -910,15 +973,24 @@ public void startBundle() {
       public void processElement(ProcessContext ctx) {
         // Need to copy the document because mongoCollection.insertMany() will 
mutate it
         // before inserting (will assign an id).
+
         batch.add(new Document(ctx.element()));
         if (batch.size() >= spec.batchSize()) {
-          flush();
+          if (spec.isUpdate()) {

Review comment:
       @pareshsarafmdb Thanks, let me take a look. 
   @pabloem Do you have any comments on this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to