MongoDB CLI Quick Reference
A compact, task-oriented cheat sheet for developers and sysadmins covering everyday mongosh workflows plus core MongoDB CLI tools for import/export, backup, and diagnostics.
A compact, task-oriented cheat sheet for developers and sysadmins covering everyday mongosh workflows plus core MongoDB CLI tools for import/export, backup, and diagnostics.
MongoDB is a document-oriented database built around flexible JSON-like documents, rich indexing, and an aggregation pipeline. This introduction covers how it works, the history and SSPL licensing, where it fits (and doesn’t), and what alternatives to consider for different data shapes and workloads.
Learn how to deploy MongoDB 8 on a Plesk server using Docker three ways: the Plesk GUI, the CLI, and Docker Compose. This guide standardizes on bind mounts under a dedicated subscription, shows single-instance first, then scales to multiple instances with host-only access, backup recipes, and ops tips.
Choosing the right storage for Docker can make or break your app’s reliability. This guide explains volumes, bind mounts, and tmpfs, how storage drivers like overlay2 affect performance, and exactly how to inspect a running container to see where its data lives—plus backups, security, and Compose tips.
When working with MongoDB, the mongorestore utility is an essential tool for restoring databases from BSON dump files. On Ubuntu 22.04, mongorestore is included in the MongoDB Database Tools package, which is distributed separately from the MongoDB server. This guide walks you through the installation process step by step. Step 1: Import the MongoDB Public GPG Key Before adding the MongoDB repository, you need to import its public GPG key:
|
1 2 |
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-6.0.gpg |
Step 2: Add the MongoDB APT Repository Add the MongoDB repository to your system’s APT sources:
|
1 2 |
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list |
Step 3: Update the Package List Update the local package index to include the new MongoDB repository:
|
1 2 |
sudo apt-get update |
Step 4: Install the MongoDB Database Tools Install the tools package, which includes mongorestore along with other utilities such as mongodump, mongoimport, and mongoexport:
|
1 2 |
sudo apt-get install -y mongodb-database-tools |
Step 5: Verify the Installation Confirm that mongorestore is installed and available on your system:
|
1 2 |
mongorestore --version |
You should see
Reliable Penguin provides managed web hosting, systems administration, website and server migrations, and expert consulting.
Submit the form—or for immediate service call 866-649-7984.