All,
I'm creating a job which will be extracting data from mongodb daily, mapping json doc to flat table and inserting that into mysql.
Problem: I have to pass start and end date ( taken from globalMap.get("start") and globalMap.get("end") ) dates to mongodb query. What component can I use to do that ? The problem with tmongodbRow component is it allows parameters , and let say i can create a javascript function with find query in it , but output document has to be mapped to a flat resultset. Unfortunately only tmongodbinput has this mapping ability. i can take fields from sub document and map them to a flat structure. BUT tmongodbinput does not allow parameters to be passed to a query.
I'm sure someone has faced this issue, i would really appreciate your response.
The solution ( sub optimal ) I've came up with is first use tmongodbrow and execute javascript function which extracts data and inserts it into a temporary mongodb collection, then next component tmongodbinput extracts all data and maps it into flat table. The problem with this approach is that db.insert(... ) in mongodb locks the database..... I would like to just run select from mongodb with "where" and avoid inserts.