You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default recent versions of mongodump create metadata files in the form of .metadata.json within the dump diretory. Theese files are not filtered and therefor restore breaks when tying to deserialize them as bson.
I suggest checking for !(/\.metadata\.json$/).test(docName) in fromJSON() before processing them further.
The text was updated successfully, but these errors were encountered:
I'm not sure if this is related but I get the following stacktrace from a fresh dump using mongodump:
❯ node seed.js
Error: corrupt bson message
at deserialize (/path-to-project/node_modules/mongodb-restore/node_modules/bson/lib/bson/parser/deserializer.js:27:9)
at BSON.deserialize (/path-to-project/node_modules/mongodb-restore/node_modules/bson/lib/bson/bson.js:115:10)
at /path-to-project/node_modules/mongodb-restore/index.min.js:89:24
at Array.forEach (<anonymous>)
at fromBson (/path-to-project/node_modules/mongodb-restore/index.min.js:81:48)
at /path-to-project/node_modules/mongodb-restore/index.min.js:113:36
at meta (/path-to-project/node_modules/mongodb-restore/index.min.js:187:16)
at /path-to-project/node_modules/mongodb-restore/index.min.js:112:18
at handleCallback (/path-to-project/node_modules/mongodb-restore/node_modules/mongodb/lib/utils.js:95:56)
at /path-to-project/node_modules/mongodb-restore/node_modules/mongodb/lib/db.js:512:22
By default recent versions of mongodump create metadata files in the form of .metadata.json within the dump diretory. Theese files are not filtered and therefor restore breaks when tying to deserialize them as bson.
I suggest checking for
!(/\.metadata\.json$/).test(docName)
in fromJSON() before processing them further.The text was updated successfully, but these errors were encountered: