Hye everyone, I am new to mongodb I dumped one of my collection using following command mongodump --db somedb --collection somecollection --out - | gzip > collectiondump.gz given on the link now when I try to restore it using mongorestore it gives Error dont know what to do with file.
kindly help me I used this way because the answer in the given link got too much upvotes
Error image
You can just add gzip to the restore command:
mongorestore --gzip --db projectx userprofiles/
Okay I have got my answer first of all I converted the extension of my gunzipped file to bson by using command
gunzip -c userprofiles.gz > users.bson
after that I used mongorestore command
mongorestore --db projectx userprofiles/
Thats it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With