I was given a data dump of bson files. In the mongo db, the database and the collections exists. These are updates to each of the collections in the database. So, in the given directory, there are about 30 bson files for each collection.
From the command line, I am using ubuntu, how do I append and load? Mongo is on my localhost with no username or password.
Thanks
Took me a while to get around this excuse for an error. In the end I went to the directory outside of my dump
folder, and did the following...
For a full DB restore:
mongorestore --drop dump/mydb
Note that the mongodump
operation will create individual folders for each database within the dump
folder it creates, so you need to specify the full relative path, as above.
For a single collection:
mongorestore --drop -d mydb -c mycollection dump/mydb/mycollection.bson
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