You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/04/14 17:03:35 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #5966: NIFI-9899-I have Fixed the MongoDBLookupService bug

exceptionfactory commented on code in PR #5966:
URL: https://github.com/apache/nifi/pull/5966#discussion_r850637375


##########
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java:
##########
@@ -223,7 +223,9 @@ protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
         return Collections.unmodifiableList(_temp);
     }
 
-    private Document findOne(Document query, Document projection) {
+    private Document findOne(Document query, Document projection,Map<String, String> context) {
+        final String databaseName = getProperty(DATABASE_NAME).evaluateAttributeExpressions(context).getValue();
+        final String collection = getProperty(COLLECTION_NAME).evaluateAttributeExpressions(context).getValue();

Review Comment:
   The `databaseName` and `collection` properties are already set in `onEnabled()`.  Moving the property evaluation to this method should also remove setting the values in the `onEnabled()` method.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org