Installation
Download and install from open_in_new mongodb.com .
Managed cloud option: open_in_new MongoDB Atlas .
MongoDB server (mongod)
Start the server process:
mongod
Database path (typical config check):
cat /etc/mongod.conf | grep dbPath
Version:
mongod --version
Mongo shell
Connect with the shell:
mongo
# Modern installs often use:
mongosh
Version:
mongo --version
# or
mongosh --version
Utilities
mongoexport
Export a collection as JSON:
mongoexport -d <databaseName> -c <collectionName> -o <file>.json
mongoimport
Import documents from a file into a collection (counterpart of mongoexport).
mongodump
Dump all databases:
mongodump
A dump folder is created automatically. Format: BSON.
mongorestore
Restore data previously produced by mongodump.
Andrew Dorokhov