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

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

Thirteen 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

-----------

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads