<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question NiFi RunMongoAggreation - How to get all documents within a time range? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-RunMongoAggreation-How-to-get-all-documents-within-a/m-p/318906#M227594</link>
    <description>&lt;P&gt;I am trying to get all documents within a time range using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RunMongoAggreation&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;In console I tried with below query and it worked fine.&lt;/P&gt;&lt;PRE&gt;aggregate([&lt;BR /&gt;{&lt;BR /&gt;"$match": {&lt;BR /&gt;"modified_at": {&lt;BR /&gt;"$gte": ISODate("2017-02-08T12:10:40.787")&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;])&lt;/PRE&gt;&lt;P&gt;Flowfile has below properties&lt;/P&gt;&lt;P&gt;startTimestamp: 2017-02-08T12:10:40.787&lt;/P&gt;&lt;P&gt;Below is the query being used in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RunMongoAggreation&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt;{&lt;BR /&gt;"$match": {&lt;BR /&gt;"modified_at": {&lt;BR /&gt;"$gte": "${startTimestamp}"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]

&lt;/PRE&gt;&lt;P&gt;Its not return result&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 05:10:15 GMT</pubDate>
    <dc:creator>Luw</dc:creator>
    <dc:date>2021-06-18T05:10:15Z</dc:date>
    <item>
      <title>NiFi RunMongoAggreation - How to get all documents within a time range?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-RunMongoAggreation-How-to-get-all-documents-within-a/m-p/318906#M227594</link>
      <description>&lt;P&gt;I am trying to get all documents within a time range using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RunMongoAggreation&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;In console I tried with below query and it worked fine.&lt;/P&gt;&lt;PRE&gt;aggregate([&lt;BR /&gt;{&lt;BR /&gt;"$match": {&lt;BR /&gt;"modified_at": {&lt;BR /&gt;"$gte": ISODate("2017-02-08T12:10:40.787")&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;])&lt;/PRE&gt;&lt;P&gt;Flowfile has below properties&lt;/P&gt;&lt;P&gt;startTimestamp: 2017-02-08T12:10:40.787&lt;/P&gt;&lt;P&gt;Below is the query being used in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RunMongoAggreation&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt;{&lt;BR /&gt;"$match": {&lt;BR /&gt;"modified_at": {&lt;BR /&gt;"$gte": "${startTimestamp}"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]

&lt;/PRE&gt;&lt;P&gt;Its not return result&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 05:10:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-RunMongoAggreation-How-to-get-all-documents-within-a/m-p/318906#M227594</guid>
      <dc:creator>Luw</dc:creator>
      <dc:date>2021-06-18T05:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi RunMongoAggreation - How to get all documents within a time range?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-RunMongoAggreation-How-to-get-all-documents-within-a/m-p/318907#M227595</link>
      <description>&lt;P&gt;Im convert match field to timestamp then compare.&amp;nbsp;&lt;STRONG&gt;Resolved&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[
    {
        "$addFields": {
            "timestamp": {
                "$toLong": "$modified_at"
            }
        }
    },
    {
        "$match": {
                "timestamp": {
                    "$gte": ${stored.state:toDate("yyyy-MM-dd HH:mm:ss"):toNumber()}
                },
                "timestamp": {
                    "$gte": ${current.state:toDate("yyyy-MM-dd HH:mm:ss"):toNumber()}
                }
         }
    },
    {
        "$skip": ${offset}
    },
    {
        "$limit": ${limit}
    },
    {
        "$project": {
            "code": 1
        }
    }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 06:00:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-RunMongoAggreation-How-to-get-all-documents-within-a/m-p/318907#M227595</guid>
      <dc:creator>Luw</dc:creator>
      <dc:date>2021-06-18T06:00:34Z</dc:date>
    </item>
  </channel>
</rss>

