How to Drive tMongoDBInput Query dynamically using global variable within Query

Four Stars

How to Drive tMongoDBInput Query dynamically using global variable within Query

I am trying to run different mongo queries based upon a data stream and a single variable.  I cannot figure out how to incorporate a 'dynamic data stream variable' or global variable within the Query parameter for the tMongoDBInput. 

 

Example for tMongoDBINput Query field:

 

"{'_id':'" + ((String)globalMap.get("EventID")) + "'}"

 

where I have defined a global variable EventID with the tsetGlobalVariable command.. just as an example.  Ideally, I would like to use a data stream from tMap to accomplish this functionality.

 

When I hardcode a value the tMongoDBInput works just fine... example:

"{'_id':'1234'}"

 

Any assistance would greatly be appreciated...Smiley Happy

 

Thanks..

 


Accepted Solutions
Eight Stars

Re: How to Drive tMongoDBInput Query dynamically using global variable within Query

please make sure the global variable "EventID"  initialized by using 

globalMap.put("EventID")="1234".

 

 

 

Share your job design for further information. 

 


All Replies
Eight Stars

Re: How to Drive tMongoDBInput Query dynamically using global variable within Query

please make sure the global variable "EventID"  initialized by using 

globalMap.put("EventID")="1234".

 

 

 

Share your job design for further information. 

 

Four Stars

Re: How to Drive tMongoDBInput Query dynamically using global variable within Query

Thanks!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch 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