When trying to restore a dump that contains a collection that has no documents in it, the BSON parser throws with 'Error: corrupt bson message'. The bson file representing the empty collection is 0 bytes and therefor invalid bson.
In fromJson() just test for data.length before deserializing and pushing to docsBulk to fix this
When trying to restore a dump that contains a collection that has no documents in it, the BSON parser throws with 'Error: corrupt bson message'. The bson file representing the empty collection is 0 bytes and therefor invalid bson.
In fromJson() just test for data.length before deserializing and pushing to docsBulk to fix this