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

    https://github.com/apache/nifi/pull/2180#discussion_r163884942
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
 ---
    @@ -221,4 +267,16 @@ protected WriteConcern getWriteConcern(final 
ProcessContext context) {
             }
             return writeConcern;
         }
    +
    +    protected void writeBatch(String payload, FlowFile parent, 
ProcessContext context, ProcessSession session, Map extraAttributes, 
Relationship rel) throws UnsupportedEncodingException {
    +        String charset = parent != null ? 
context.getProperty(CHARSET).evaluateAttributeExpressions(parent).getValue()
    +                : 
context.getProperty(CHARSET).evaluateAttributeExpressions().getValue();
    +
    +        FlowFile flowFile = session.create(parent);
    +        flowFile = session.importFrom(new 
ByteArrayInputStream(payload.getBytes(charset)), flowFile);
    +        flowFile = session.putAttribute(flowFile, 
CoreAttributes.MIME_TYPE.key(), "application/json");
    --- End diff --
    
    THANK YOU for including this :) so many processors that output a specific 
format (even converters!) do not set the mime.type attribute, which makes 
viewing them from the UI a pain.


---

Reply via email to