Hi everyone!
I’ll start with what I’m trying to do and then get to what hurdles I’ve met:
I made a nodejs mini app that :
- Gets all the collections from my database
- For each collection is spawns a worker that runs a mongoexport command with a query that exports to a json using the jsonArray flag
The aim of this app is to export all the information related to…let’s say a customer, from all collections
The main issue that I’m getting is that the mongoexport commands work by themselves but when I try to run them in parallel using the worker threads they all fail with
could not connect to server: connection() : dial tcp: i/o timeout
For now I’m stuck exporting iteratively but it would be great if I could do this async in some way, this is because I’m dealing with over 15gb of data .
Another question would be if I could parallelize AND divide mongoexport commands in batches for example: job1 exports the first 10000 results, job2 from 100001 to 20000 and so on …
I would be grateful if anyone has an idea on how I can manage this. Thanks in advance!