← Back to Solutions

How to Install MongoDB

By Edvvo | 2026
Set up a supported MongoDB installation, verify a private local connection and practise inserting, querying and updating study records.

Install the right components

MongoDB Server stores documents. The mongosh shell sends commands to that server, while Compass is an optional graphical client. Installing a client alone does not start a database. Use the official Community installation reference below and select instructions for your operating system and chosen supported server version. Package repositories and supported operating systems change; do not reuse commands for an older distribution.

Verify a private local connection

Install mongosh if it is not already present. Start the server using the service instructions for your installation. In a terminal, check the shell and connect to a local server:

mongosh --version
mongosh "mongodb://127.0.0.1:27017"

If your server requires authentication, use its configured credentials and authentication database. Do not disable authentication to get past an error. Inside mongosh, run:

db.runCommand({ ping: 1 })

A successful response includes ok: 1. A connection refusal usually means the server is not listening at that address or port; check its service status and logs before changing firewall settings.

Create one practice record

Use a disposable local practice database, not a school or production database. Enter these commands inside mongosh, not PowerShell:

use edvvo_practice
db.sessions.insertOne({
  topic: "Linear equations",
  minutes: 25,
  completed: false
})
db.sessions.find({ topic: "Linear equations" })
db.sessions.updateOne(
  { topic: "Linear equations" },
  { $set: { completed: true } }
)
db.sessions.find({ completed: true })

The insert result contains the new document ID. The first query should show the topic, numeric minutes and false completion value. The update should match one record; the final query should show it with completed set to true.

Diagnose unexpected results

Running insertOne repeatedly creates several documents. A topic is not a unique identifier: updateOne changes one matching document, not necessarily the one you intended. For a precise update, copy the returned _id and query by that ID. A string such as "25" is different from the number 25, so use consistent field types when comparing values.

Keep the exercise safe

Do not expose this practice database to the internet, add real student records or paste credentials into screenshots. Local connection examples are not production security configurations. Before deploying a real application, follow the vendor guidance for authentication, restricted network access, backups and least-privilege application accounts.

Your next exercise

Insert a second, differently named topic. Query only completed sessions, then query sessions with minutes greater than 20. Predict which records should appear before running each query. Keep a note of the command and actual output so you can distinguish a connection problem from a query problem.

MongoDBInstallationDatabaseGuide

Your privacy choices

We use optional analytics to understand visits and advertising to support Edvvo. These services stay off unless you accept. Your study tools work either way. Read our privacy policy.