[ 
https://issues.apache.org/jira/browse/NIFI-4827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16377254#comment-16377254
 ] 

ASF GitHub Bot commented on NIFI-4827:
--------------------------------------

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

    https://github.com/apache/nifi/pull/2443#discussion_r170676899
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
 ---
    @@ -76,13 +77,28 @@
             return builder.explanation(reason).valid(reason == null).build();
         };
     
    -    static final PropertyDescriptor QUERY = new 
PropertyDescriptor.Builder()
    -            .name("Query")
    -            .description("The selection criteria; must be a valid MongoDB 
Extended JSON format; if omitted the entire collection will be queried")
    -            .required(false)
    -            .expressionLanguageSupported(true)
    -            .addValidator(DOCUMENT_VALIDATOR)
    +    static final Relationship REL_SUCCESS = new 
Relationship.Builder().name("success").description("All files are routed to 
success").build();
    +    static final Relationship REL_FAILURE = new Relationship.Builder()
    +            .name("failure")
    +            .description("All input flowfiles that are part of a failed 
query execution go here.")
    +            .build();
    +
    +    static final Relationship REL_ORIGINAL = new Relationship.Builder()
    +            .name("original")
    +            .description("All input flowfiles that are part of a 
successful query execution go here.")
                 .build();
    +
    +    static final PropertyDescriptor QUERY = new 
PropertyDescriptor.Builder()
    +        .name("Query")
    +        .description("The selection criteria to do the lookup. If the 
field is left blank, it will look for input from" +
    +                " an incoming connection from another processor to provide 
the query as a valid JSON document inside of " +
    +                "the flowfile's body. If this field is left blank and a 
timer is enabled instead of an incoming connection, " +
    --- End diff --
    
    This needs to be reverted to the original description of behavior when 
blank, that the entire collection will be queried. If this is not the intent, 
and an error should be thrown, then you'll need to change the logic around line 
264


> Make GetMongo able to use flowfiles for queries
> -----------------------------------------------
>
>                 Key: NIFI-4827
>                 URL: https://issues.apache.org/jira/browse/NIFI-4827
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Mike Thomsen
>            Assignee: Mike Thomsen
>            Priority: Minor
>
> GetMongo should be able to retrieve a valid query from the flowfile content 
> or allow the incoming flowfile to provide attributes to power EL statements 
> in the Query configuration field. Allowing the body to be used would allow 
> GetMongo to be used in a much more generic way.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to