Six Stars

Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

Hi,

I have a tMongoDBInput component, and i want to use a query type : "Aggregation Pipeline Query".

When in put a line with my request in the tab "Aggregation stages", (see code snippet below), i have lot of errors / Syntax errors. how can i solve the problem ? thanks.

 

Code MongoDB Request Snippet :

db.lines.find({$and:[{'type':{$in:['id']}},
{'processus_time':{$gte: new Date(new Date("2017-05-28T16:00:00Z").setHours(0,0,0,0)).toISOString()}},
{'processus_time':{$lte: new Date(new Date().setHours(23,59,59,999)).toISOString()}},
{'a':null}]})

  • Data Integration
6 REPLIES
Nine Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

try this:

"db.lines.find({$and:[{'type':{$in:['id']}},
{'processus_time':{$gte: new Date(new Date(\"2017-05-28T16:00:00Z\").setHours(0,0,0,0)).toISOString()}},
{'processus_time':{$lte: new Date(new Date().setHours(23,59,59,999)).toISOString()}},
{'a':null}]})"

double quotes around query and escape \ for internal quotes

-----------
Six Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

hi

thanks for your response. i tried this (copy paste), and i have now :

Talend Error : String literal is not properly closed by a double quote.

 

Tags (1)
Nine Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

please attach screenshot, because it work 

2 pair of eyes better than 1 ;-)

-----------
Six Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

mongoDBerror.PNG

Six Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

up

Nine Stars

Re: Bug : How to make Aggregation Pipeline Query with tMongoDBInput component ?

what is error text?

not seen - wha component return error? not seen full text in window

-----------