tMongoDBInput query for date gte

Highlighted
One Star

tMongoDBInput query for date gte

I have some documents in MongoDB that has a DateTime field
{"Name" : "a name", "InsertDate" : ISODate("2014-01-23T14:32:11.746Z")}
and I want to get all the document with InsertionDate greater than 2014-01-23 00:00:00.
I tried the following queries but doesn't work:
{"InsertDate": {"$gt":ISODate("2014-01-23T00:00:00Z")} (got Error com.mongodb.util.JSONParseException pointing to ISODate)
{"InsertDate": {"$gt":new Date("2014-01-23T00:00:00Z")} (got Error com.mongodb.util.JSONParseException pointing to new Date)
Some one suggested I should use a syntax like: {"InsertDate": {"$gt":{"$date":"2014-01-23T00:00:00Z"}} but does not produce the results I expect (got no Error from Talend but doesn't retrieve any document (probably this syntax is not supported by Mongo)).
Any suggestions on how to include in query?
I am using TOS for BigData and MongoDB 2.2.3.
Moderator

Re: tMongoDBInput query for date gte

Hi,
Please try to replace ISODate("2014-01-23T00:00:00Z")
with
{ "$date": "2014-01-23T00:00:00Z"} to see if it is OK with you.
Here is a on-line related doc for mongodb-extended-json
http://docs.mongodb.org/manual/reference/mongodb-extended-json/
and stackoverflow articles http://stackoverflow.com/questions/19819870/date-query-with-isodate-in-mongodb-doesnt-seem-to-work and http://stackoverflow.com/questions/20561381/mongodb-nodejs-how-to-query-isodate-fields.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now