You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/03/18 22:38:00 UTC

[jira] [Commented] (NIFI-6293) MongoDB Aggregation does not parse dates

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

ASF subversion and git services commented on NIFI-6293:
-------------------------------------------------------

Commit 943de310ad5b5fa6c128882da84c88621abd69b3 in nifi's branch refs/heads/master from Eduardo Fontes
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=943de31 ]

NIFI-6293

Add support to Mongo Extended JSON v2
Add org.json lib
Replace evil json
Replace evil json for alternative
Include testExtendedJsonSupport
Style adjustment
Remove unecessary new JSON parser
Fix query in testExtendedJsonSupport
Parse with Jackson and BSON
Back to default MONGO_URI

This closes #4068

Signed-off-by: Mike Thomsen <mt...@apache.org>


> MongoDB Aggregation does not parse dates
> ----------------------------------------
>
>                 Key: NIFI-6293
>                 URL: https://issues.apache.org/jira/browse/NIFI-6293
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 1.11.2
>         Environment: Ubuntu 16.04, MongoDB 4.0.3, TLS to MongoDB.
>            Reporter: Emil Sarkissian
>            Assignee: Eduardo Mota Fontes
>            Priority: Major
>              Labels: easyfix, newbie, pull-request-available
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> *Repro Steps*:
>  # Create a "Generate Flow File" Processor to kick off things
>  # Connect that to a Nifi MongoDB Aggregation Processor
>  # Set the query to a $match with date criteria, for example:
> {code:java}
> [ { "$match": { "someDate": { "$gt": "2019-01-01T00:00:00Z" } } } ]{code}
>  
> *Expected Result*: Query returns correct documents per the date criteria.
> *Actual Result*: Condition always evaluates to false and no documents are returned.
> *Notes:*
>  # I have tried every possible way to make this work, including \{ "$date": "2019-01-01T00:00:00Z" } and also using "$expr" with Mongo, as well as "$dateFromString", and "$convert".
>  # Using an "$expr" seems to work functionally but refuses to use any indexes - probably a MongoDB issue (4.0.3 is what I run) and introduces unnecessary complexity.
> I have fixed this for our fork, as we need to go to Production soon, but I am new to the contribution process and didn't want to just put a feature branch without explaining the issue.
> The fix is to provide a Jackson custom deserializer to handle dates based on what Date Format is specified on the processor.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)