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

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}]})

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

Forteen 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

-----------

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now