Online MongoDB

Explore MongoDB online with document queries and shell commands. Learn how collections store JSON-like documents and continue with practical database labs.

  • Free online practice
  • Real LabEx environments
  • No installation
  • Documents
  • Collections
  • Query filters
Learn MongoDB

MongoDB Shell· Ready

Welcome to the LabEx MongoDB Shell. Press Enter to run your first command. Type help for session commands.
Commands run locally in your browser.

Start here

Quick Start with MongoDB Playground

Load a task into the terminal, then press Enter to see the result. Each example works in the introductory session on this page.

Read sample documents

The learners collection is preloaded with names and scores.

db.learners.find()

Read one document

Inspect the first learner document.

db.learners.findOne()

Count documents

Count all documents in the sample collection.

db.learners.countDocuments()

Filter by name

Match a field using an equality filter.

db.learners.find({name: "Alex"})

Insert a document

Add a learner, then query the collection again.

db.learners.insertOne({name: "Sam", score: 88})

Update a document

Change Alex’s score and inspect the result with find.

db.learners.updateOne({name: "Alex"}, {$set: {score: 95}})

Delete a document

Remove one matching learner document.

db.learners.deleteOne({name: "Sam"})

List collections

Discover the learners collection in the test database.

show collections

No setup needed

How the MongoDB Playground Works

Explore MongoDB online with document queries and shell commands. Learn how collections store JSON-like documents and continue with practical database labs.

Start with the short command exercises above. When you are ready for a project, open the linked LabEx lab to work with real tools in an online Linux environment, with step-by-step guidance and immediate feedback.

Build practical MongoDB skills

  • Documents
  • Collections
  • Query filters
Explore MongoDB Labs

Keep learning

Learn MongoDB with Hands-On Labs

Build on your MongoDB experiments with a structured skill tree. Explore the skills, choose a guided lab, and practice each concept in an online environment.

Online MongoDB FAQ

Does this use MongoDB shell syntax?

The introductory exercises use MongoDB-style document and collection commands. Sign in to the linked MongoDB lab to use a real database and continue with queries, indexes, and aggregation.

Is the MongoDB Playground free?

The introductory exercises are free. Sign in for a complete LabEx environment; session duration and resources depend on your lab and plan.

Do I need to install software?

No local installation is required. Sign in and open the lab in a modern browser. Follow the lab instructions to configure software inside the environment.

Where can I use more commands and features?

This preview supports a limited command set. Sign in and launch the MongoDB lab for more commands, packages and services. Available software and permissions depend on the selected lab.

How do I continue learning MongoDB?

Follow the MongoDB Skill Tree for guided labs and challenges. Practice regularly, inspect command output and ask Labby for help.

Your next step

Ready to practice MongoDB?

Continue with real tools, guided labs, and Labby assistance.

Try LabEx MongoDB Labs