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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Six 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. 

 

2 REPLIES
Six 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!