- The panel runs MongoDB query syntax with Mingo 7.2.4 in your browser. It is not a MongoDB server and does not connect to one.
- Pick a collection (products, customers or orders) and an operation: find takes a filter document, aggregate takes a pipeline array.
- You can type strict JSON or mongosh-style input with unquoted keys and single quotes. Up to 1,000 documents are shown as JSON.
- For a real server at no cost, MongoDB Atlas offers a Free cluster (formerly called M0), and MongoDB Community Server runs locally or in Docker.
How to use the MongoDB online playground
- Choose a Collection:
products(9 documents: name, category, price, tags, stock),customers(5: name, country, address.city, vip) ororders(6: customer_id, date, status, items, total). - Choose find (filter) and type only the filter document, for example
{ price: { $gt: 20 } }, not the fulldb.products.find(...)call. Or choose aggregate (pipeline) and type an array of stages. - Press Run or Ctrl+Enter (Cmd+Enter on a Mac). The matching documents appear as JSON, with a count and timing.
Copy share link puts your query in the URL after #q= (nothing is stored on a server; the link fills the editor but does not run it). Reset data restores the sample collections. In a pipeline, $lookup can join the other two collections. Sample data: tables and columns under the editor lists every field in each collection.
Example queries for MongoDB online practice
Set the collection and operation shown in each label before running. The syntax is the same as in mongosh.
{ category: 'Hardware', price: { $lt: 60 } }{ 'address.city': 'Leeds' }[
{ $group: { _id: '$status', orders: { $sum: 1 }, revenue: { $sum: '$total' } } },
{ $sort: { revenue: -1 } }
][
{ $match: { status: 'delivered' } },
{ $lookup: { from: 'customers', localField: 'customer_id', foreignField: '_id', as: 'customer' } },
{ $project: { total: 1, 'customer.name': 1 } }
]What the playground is not
Mingo describes itself as the MongoDB query language for in-memory objects. It implements MongoDB's operators in JavaScript, separately from MongoDB itself, so treat results as practice and confirm important queries on a real server. In particular:
- There are no shell commands (
db.collection.insertOne,show dbs), indexes,explainoutput or users. - find takes a filter only; to shape the output, use a
$projectstage in an aggregation. - The three collections are fixed and reset when you reload the page.
Free ways to run real MongoDB
MongoDB Atlas Free cluster. MongoDB's pricing page describes a free-forever tier, which the Atlas documentation now calls a Free cluster (formerly M0). It includes 512 MB of storage, 32 MB of sort memory and up to 100 operations per second. You can deploy one Free cluster per project, and Atlas uses MongoDB 8.0 for Free clusters. Atlas also lets you run aggregation pipelines in its web interface. See our MongoDB Atlas pricing page and MongoDB hosting options.
MongoDB Community Server. The free Community Edition installs on Windows, macOS and Linux from mongodb.com. MongoDB's documentation also covers running it in Docker with its mongodb/mongodb-community-server image, and there is a Docker Official Image called mongo. Connect with mongosh, which MongoDB describes as a JavaScript and Node.js REPL for working with MongoDB deployments.
Coming from SQL? Read SQL vs NoSQL and MongoDB vs PostgreSQL.
Privacy
Mingo and the sample collections are loaded from this site and run in your browser. What you type is parsed as data (it is never executed as code) and is not sent to CodeWithSQL or to MongoDB. A share link contains your query text, so anyone with the link can read it.
To practise the SQL side, try the SQL exercises or the SQL beginner course.
Frequently asked questions
Is this a real MongoDB database?
No. It is Mingo, a JavaScript library that evaluates MongoDB filters and aggregation pipelines over documents held in your browser. Use it to learn the syntax, then run queries on Atlas or a local server.
Can I host MongoDB online for free?
Yes, with an Atlas Free cluster: 512 MB of storage and up to 100 operations per second, one per project. MongoDB positions it for learning and exploring rather than production.
Can I paste a query from mongosh?
Paste the filter or the pipeline array, not the db.collection.find(...) wrapper. Unquoted keys and single-quoted strings are accepted.
Is there a MongoDB Compass online?
MongoDB Compass is a GUI that you download and run on macOS, Windows or Linux, not a website. The nearest browser-based options are the Atlas web interface for your own Atlas clusters and this playground for practice.
Can I join collections?
Yes. In an aggregation, a $lookup stage can read from any of the three sample collections, as in the example above.
Sources
- Mingo on GitHub
- MongoDB Atlas pricing
- MongoDB Atlas docs: Free cluster limits
- MongoDB docs: db.collection.find()
- MongoDB docs: Aggregation operations
- MongoDB docs: $lookup
- MongoDB docs: Install Community Edition with Docker
- MongoDB docs: MongoDB Shell (mongosh)
- Docker Official Image: mongo
- MongoDB docs: Install MongoDB
- MongoDB Compass documentation
Checked 8 October 2026.
How we research tool pages: our editorial method. The engines are open-source projects credited on each page.