mongoexport exporting only 94 % of the available data

87 Views Asked by At

I am trying to export the data from MongoDB to my local machine. Below is the command that I running:

mongoexport --host="${hostname}:${port}" --authenticationDatabase admin -u ${user} -p ${password} --db ${database_name} --collection=${collection_name}  --out=${file}.json

Below is the result:

2021-05-20T14:15:40.604+0200    connected to:${host}:${port}
2021-05-20T14:15:41.491+0200    [........................]  ${database}.${collection}  0/38050  (0.0%)
2021-05-20T14:15:42.491+0200    [........................]  ${database}.${collection}   0/38050  (0.0%)
2021-05-20T14:15:43.491+0200    [........................]  ${database}.${collection}   0/38050  (0.0%)
2021-05-20T14:15:44.491+0200    [###############.........]  ${database}.${collection}   24000/38050  (63.1%)
2021-05-20T14:15:44.786+0200    [######################..]  ${database}.${collection}   35871/38050  (94.3%)
2021-05-20T14:15:44.786+0200    exported 35871 records

I tried the export also with the command below:

mongoexport --uri="mongodb://${user}:${password}@${host}:${port}/${database}?authSource=admin"   --collection=${collection}  --out=${file}.json

But the result is the same. I am not understanding why I am not able to export all the data available in the collection.

Regards, Rando.

P.S I have already check to see if I have enough space to store the file. I have more than 20 GB free on the folder where I am trying to export the file.

0

There are 0 best solutions below