NOTE - Remove -h option if you are doing operation on same machine
Import database
mongorestore -h IP:port -d DB_Name -u <user> -p <password> <input db directory>
Export database
mongodump -h IP:port -d DB_Name -u <user> -p <password> -o <output directory>
Import collection
mongorestore -h IP:port -d DB_Name -u <user> -p <password> <input .bson file>
Export collection
mongodump -h IP:port -d DB_Name -c <collection> -u <user> -p <password> -o <output directory>
Import collection
mongoimport -h IP:port -d DB_Name -c <collection> -u <user> -p <password> --file <input file>
Export collection
mongoexport -h IP:port -d DB_Name -c <collection> -u <user> -p <password> -o <output file>
Import collection
mongoimport -h IP:port -d DB_Name -c <collection> -u <user> -p <password> --file <input .csv file> --type csv --headerline
Export collection
mongoexport -h IP:port -d DB_Name -c <collection> -u <user> -p <password> -o <output .csv file> --csv -f <comma-separated list of field names>