I am new to mongodb and want to know about importing a json file from one server to another. I tried the following command mongoimport -d tes
mongodb
json
mongoimport -d tes
I came up with a more elegant way to automatically import ALL collections:
ls -1 *.json | sed 's/.json$//' | while read col; do mongoimport -d db_name -c $col < $col.json; done
I hope this is helpful.