AnsweredAssumed Answered

Comparing timestamps between two tables in MongoDB

Question asked by Roguen Keller Employee on May 15, 2018
Latest reply on May 18, 2018 by Roguen Keller

Hi everyone,

This is really as much a Mongo DB question as much as a PDI/Spoon question, but perhaps someone who knows both can point me in a good direction on where I can start.


I have used the MongoDB output steps to add the data that I need into a database, let's call it data, and since these were two database the collections will be called table1 and table2.


What I would like to do it take one of the fields from data.table1(a timestamp) and use it to query data.table2 on its own field (another timestamp) within a range:

So for example if the timestamp in data.table1 was 1526342400 (that would be 5/15/18 at 00:00:000 GMT)

I would want to get back all rows from data.table2 ranging from 1526256000 to 1526342400 (same time the day before)


So what I know is that I can grab the MongoDB input step, and I can query my first table (data.table1) for this, and I'm assuming that I can put another input step next to that to query the second table and pass my timestamp from the first, but I'm confused about how to set up my query in this second step to accept that timestamp from the first.


Thank you for your help and suggestions.

I am using Pentaho PDI 7.0 EE for this.