Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

Labels (3)
8 Replies
Anonymous
Not applicable
Author

Is there not a solution for this?

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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).

 


Talend_Error.png
Anonymous
Not applicable
Author

Hello Sabrina,

 

No solution yet?

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Thank you Sabrina. Will wait for your findings.

 

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

haPoalim
Contributor
Contributor

I have the same problem
there any solution ?
Anonymous
Not applicable
Author

Hello,

Could you please show us your query in tmongodbinnput?

Here are related success use cases and feel free to let us know if it helps for you.

https://community.talend.com/t5/Design-and-Development/tMongoDBInput-Exception-when-using-match-stag...

https://community.talend.com/t5/Design-and-Development/aggregation-query-in-tmongoDBInput/m-p/54857

Best regards

Sabrina