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

    https://github.com/apache/nifi/pull/2443#discussion_r170070552
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
 ---
    @@ -236,12 +254,33 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
                         
context.getProperty(QUERY).evaluateAttributeExpressions().getValue());
             }
     
    -        final Document query = context.getProperty(QUERY).isSet()
    -                ? 
Document.parse(context.getProperty(QUERY).evaluateAttributeExpressions().getValue())
 : null;
    +        final Document query;
    +        if (!context.hasIncomingConnection() && 
!context.getProperty(QUERY).isSet()) {
    +            query = Document.parse("{}");
    --- End diff --
    
    I thought this was going to be a validation error? It can be done in 
OnScheduled, see ExecuteSQL for an example. Otherwise how would the user know 
that his/her configuration won't actually perform any work?


---

Reply via email to