Given I have a collection with following documents:
{_id:..., job:..., time: 123192387231}
(time is time in milliseconds since 1970, unix time)
What would be the best way to retreive all documents which time is in the next 20 seconds to come?
In SQL I would do something like this:
SELECT * FROM X WHERE time-sysdate < 20 && time-sysdate > 0
(Dates work with days in SQL I know :D)