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

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

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

    https://github.com/apache/nifi/pull/2619#discussion_r192783531
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java
 ---
    @@ -52,68 +54,125 @@
         "The query is limited to the first result (findOne in the Mongo 
documentation). If no \"Lookup Value Field\" is specified " +
         "then the entire MongoDB result document minus the _id field will be 
returned as a record."
     )
    -public class MongoDBLookupService extends MongoDBControllerService 
implements LookupService<Object> {
    +public class MongoDBLookupService extends SchemaRegistryService implements 
LookupService<Object> {
    +    public static final PropertyDescriptor CONTROLLER_SERVICE = new 
PropertyDescriptor.Builder()
    --- End diff --
    
    AFAICT this property is never added to the list of supported property 
descriptors, so I couldn't set it on the UI which causes an NPE when lookup() 
is called. Seems odd that for a required property that is not supported, 
setting it (in tests) would not complain. I haven't run the integration tests 
yet, just put the NARs into a live NiFi to try it out. 


> MongoDBLookupService should be able to determine a schema or have one provided
> ------------------------------------------------------------------------------
>
>                 Key: NIFI-5059
>                 URL: https://issues.apache.org/jira/browse/NIFI-5059
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Mike Thomsen
>            Assignee: Mike Thomsen
>            Priority: Major
>
> MongoDBLookupService should have two schema handling modes:
>  # Where a schema is provided as a configuration parameter to be applied to 
> the Record object generated from the result document.
>  # A schema will be generated by examining the result object and building one 
> that roughly translates from BSON into the Record API.
> In both cases, the schema will be applied to the Mongo result Document object 
> that is returned if one comes back.



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

Reply via email to