arrow_back
Back

MongoDB installation, server, shell, and utilities

Andrew Dorokhov Andrew Dorokhov schedule 1 min read
menu_book Table of Contents

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.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

MongoDB queries: databases, collections, and CRUD

arrow_forward