I have a root directory, for example events.
Every event is a directory containing files, and there are millions of events.
Directories in the events directory:
...
2018-01-17-18:40:51.151343-1bb809
2018-01-17-20:55:22.627688-26ada5
2018-01-17-20:55:27.919532-8243cd
2018-01-17-20:56:30.743072-94e913
2018-01-17-20:57:39.824845-64ccb7
...
What I am trying to do is:
Load the directories one by one, instead of doing it in one call e.g. fs.readDir
As the directory names are timestamped, I want to be able to query them with
e.g.
{ time:
$gte: t1
$lte: t2
}
How would I do this query, with performance, without reading all the directories in memory at once?
I am using NodeJs 9