I want to add a existing .bson file to a database that i have created in MongoDB. I tried using
db.collection.copyto()
and db.cloneCollection()
but no luck.
if anybody could help with any particular method or other way to do the same. PS : I am new to MongoDB.
You can use mongorestore
mongorestore --database dbName --collection collectionName /path/file.bson