<?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>topic Re: How to Query MongoDB on a Date Column in Talend Big Data? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313984#M84791</link>
    <description>You have to set the attribute names and string values in double quotes like this:&lt;BR /&gt;&lt;PRE&gt;"{\"id\":\"my_value\"}"&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Nov 2016 07:43:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-11-16T07:43:02Z</dc:date>
    <item>
      <title>How to Query MongoDB on a Date Column in Talend Big Data?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313981#M84788</link>
      <description>Hi, 
&lt;BR /&gt;Lets say I insert a date into MongoDB using tMongoDBConnection--&amp;gt;tFixedFlowInput--&amp;gt;tMongoDBOutput, using TalendDate.parseDate("yyyy-MM-dd","2014-01-01"). 
&lt;BR /&gt;I can go into the Mongo shell, and query the collection: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAxG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138880i299D82A8DC1D8029/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAxG.png" alt="0683p000009MAxG.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I can see that the record has been inserted using ISODate. 
&lt;BR /&gt;In the shell I would query it like this ( {dt:ISODate("2014-01-01T08:00:00Z")} ) : 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB8r.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143983i50353094D697AD3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB8r.png" alt="0683p000009MB8r.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;However, if I write the identical query in tMongoDBInput: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB6X.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144021i5BC42F9ED6848F86/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB6X.png" alt="0683p000009MB6X.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I receive the following error: 
&lt;BR /&gt;Exception in component tMongoDBInput_1 
&lt;BR /&gt;com.mongodb.util.JSONParseException: 
&lt;BR /&gt;{'dt':ISODate('2014-01-01T08:00:00Z')} 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSONParser.parse(JSON.java:198) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSONParser.parseObject(JSON.java:231) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSONParser.parse(JSON.java:195) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSONParser.parse(JSON.java:145) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSON.parse(JSON.java:81) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.mongodb.util.JSON.parse(JSON.java:66) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at primehome.testmongodate_0_1.TestMongoDate.tMongoDBInput_1Process(TestMongoDate.java:605) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at primehome.testmongodate_0_1.TestMongoDate.tMongoDBConnection_1Process(TestMongoDate.java:371) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at primehome.testmongodate_0_1.TestMongoDate.runJobInTOS(TestMongoDate.java:989) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at primehome.testmongodate_0_1.TestMongoDate.main(TestMongoDate.java:854) 
&lt;BR /&gt;This question has been asked on the Talend Forum 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCmpmCAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/tMongoDBInput-query-for-date-gte/td-p/85560&lt;/A&gt; but I was unable to get the answer, which said to query using the "$date" operation, to work. 
&lt;BR /&gt;In the Mongo Shell, I cannot use the query {'dt': {'$date':'2014-01-01T08:00:00Z'}} without the following error: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB8w.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128067i595F8E9EDFAE2E3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB8w.png" alt="0683p000009MB8w.png" /&gt;&lt;/span&gt;"Can't canonicalize query: BadValue unknown operator: $date". 
&lt;BR /&gt;In the mongoshell, If I do a query like {dt: {$lte : {$date : '2020-01-01T00:00:00Z'}}} I receive no error, but I also receive no document: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB91.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148377i201BC8E70EB88068/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB91.png" alt="0683p000009MB91.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Is there a way to query MongoDB for dates in Talend? 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Matthew</description>
      <pubDate>Sat, 16 Nov 2024 11:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313981#M84788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Query MongoDB on a Date Column in Talend Big Data?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313982#M84789</link>
      <description>Perhaps the MongoDB driver works a bit different as the shell. Why do you quote the attribute name? Actually this is not necessary and I guess this is the problem.</description>
      <pubDate>Wed, 08 Oct 2014 07:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313982#M84789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-08T07:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Query MongoDB on a Date Column in Talend Big Data?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313983#M84790</link>
      <description>How to get the previous date data from mongodb using talend i am also getting the same error in tmongodbinput component</description>
      <pubDate>Wed, 16 Nov 2016 05:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313983#M84790</guid>
      <dc:creator>krengan21</dc:creator>
      <dc:date>2016-11-16T05:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Query MongoDB on a Date Column in Talend Big Data?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313984#M84791</link>
      <description>You have to set the attribute names and string values in double quotes like this:&lt;BR /&gt;&lt;PRE&gt;"{\"id\":\"my_value\"}"&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Nov 2016 07:43:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Query-MongoDB-on-a-Date-Column-in-Talend-Big-Data/m-p/2313984#M84791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-16T07:43:02Z</dc:date>
    </item>
  </channel>
</rss>

