Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2180#discussion_r160446538
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
 ---
    @@ -221,4 +247,12 @@ protected WriteConcern getWriteConcern(final 
ProcessContext context) {
             }
             return writeConcern;
         }
    +
    +    protected void writeBatch(String payload, ProcessContext context, 
ProcessSession session) throws UnsupportedEncodingException {
    +        FlowFile flowFile = session.create();
    --- End diff --
    
    We should pass in a reference to the parent flow file (or null if it 
doesn't exist). GetMongo does not allow input so there never is a parent, hence 
the session.create(). However in RunMongoAggregation if there is a parent flow 
file, it should be used in the session.create(parentFlowFile) to maintain 
correct provenance. I believe session.create(null) works fine so you don't need 
a check.
      


---

Reply via email to