[
https://issues.apache.org/jira/browse/NIFI-4827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376985#comment-16376985
]
ASF GitHub Bot commented on NIFI-4827:
--------------------------------------
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2443#discussion_r170616361
--- Diff:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
---
@@ -236,12 +261,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.getProperty(QUERY).isSet()) {
+ String queryStr =
context.getProperty(QUERY).evaluateAttributeExpressions(input).getValue();
+ query = Document.parse(queryStr);
+ } else if (!context.getProperty(QUERY).isSet() && input == null) {
+ query = Document.parse("{}");
--- End diff --
Ok. I think what I'll do is just put the query attribute on there no matter
what if the query attribute is set because that'll help people figure out what
happened in every scenario where a query was sent to Mongo.
> 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)