I know this topic is old, but I think I am having a similar problem. I have been searching from a solution all over Stackoverflow
I am running a mongodump followed by a mongorestore and in 2 out of 12 collections the numbers of documents restored are way less than the number of documents on the backup. The thing is there are no errors.
Bellow is the output fot the 2 collections on the dump
2020-01-22T10:16:26.961-0300 done dumping montele.usuario (960 documents)
2020-01-22T10:29:35.268-0300 done dumping montele.negocio (86851 documents)
And now the output for the restore
2020-01-22T10:35:21.121-0300 finished restoring montele.usuario (31 documents, 0 failures) 2020-01-22T10:37:29.974-0300 finished restoring montele.negocio (26120 documents, 0 failures)
Interesting enough .... if I run the mongorestore again without dropping the db this happens (I did this to see if it would add the remaining data):
2020-01-22T11:30:41.914-0300 finished restoring montele.negocio (0 documents, 86851 failures)
With the failure code being:
E11000 duplicate key error collection: montele.negocio index: id dup key:
I hope someone can shine a light and point me in right direction.