Four Stars

tMongoDBInput Aggregation Pipeline query

Hello All,

 

I'm trying to to put together a Aggregation Pipeline query in tMongoDBInput and it doesn't work(I get no records out) irrespective of whatever condition I use for filtering by date. If I remove the condition for date, everything works fine.

 

Attached a screenshot of what condition I have and the context value is 2017-06-24 08:07:28.113Z.

 

It would be great if somebody can provide some assistance.

  • Data Integration
  • Talend Integration Cloud
6 REPLIES
Four Stars

Re: tMongoDBInput Aggregation Pipeline query

Is there not a solution for this?

Moderator

Re: tMongoDBInput Aggregation Pipeline query

Hi,

Sorry for late response.

Can you successfully execute your filter by using 2017-06-24 08:07:28.113Z without using context value?

On which build version you got this issue?

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.
Four Stars

Re: tMongoDBInput Aggregation Pipeline query

Hello Sabrina,

 

No problem. I use TOS Big Data 6.4.1.

This one - {$match: {order_date:{$gt: new Date("2017-06-24 08:07:28.113Z")}}}, works directly in the Mongo shell, but when I use it in MongodbInput as "{$match: {order_date:{$gt: new Date(\"2017-06-24 08:07:28.113'Z'\")}}}", I get the following error after the build,

 

Exception in component tMongoDBInput_1 (ItemInSalesOrder_Copy_Copy)
com.mongodb.util.JSONParseException:
{$match: {order_date:{$gt: new Date("2017-06-24 08:07:28.113'Z'")}}}
^
at com.mongodb.util.JSONParser.read(JSON.java:280)
at com.mongodb.util.JSONParser.parse(JSON.java:171)
at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
at com.mongodb.util.JSONParser.parse(JSON.java:205)
at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
at com.mongodb.util.JSONParser.parse(JSON.java:205)
at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
at com.mongodb.util.JSONParser.parse(JSON.java:205)
at com.mongodb.util.JSONParser.parse(JSON.java:155)
at com.mongodb.util.JSON.parse(JSON.java:93)
at com.mongodb.util.JSON.parse(JSON.java:74)
at bd_newproject.iteminsalesorder_copy_copy_0_1.ItemInSalesOrder_Copy_Copy.tMongoDBInput_1Process(ItemInSalesOrder_Copy_Copy.java:2234)
at bd_newproject.iteminsalesorder_copy_copy_0_1.ItemInSalesOrder_Copy_Copy.runJobInTOS(ItemInSalesOrder_Copy_Copy.java:4619)
at bd_newproject.iteminsalesorder_copy_copy_0_1.ItemInSalesOrder_Copy_Copy.main(ItemInSalesOrder_Copy_Copy.java:4436)

 

When I change it this way - "{$match: {order_date:{$gt: '" + TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "2017-06-24 08:07:28.113'Z'") + "'}}}",

 

I get the error(attached), when I press run(before the build completes).

 

Four Stars

Re: tMongoDBInput Aggregation Pipeline query

Hello Sabrina,

 

No solution yet?

Moderator

Re: tMongoDBInput Aggregation Pipeline query

Hello,

We are making an investigation on your issue and then come back to you as soon as we can.

Thank for your time.

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.
Four Stars

Re: tMongoDBInput Aggregation Pipeline query

Thank you Sabrina. Will wait for your findings.

 

By the way, the datatype for the field in DB is Date.