# MongoDB

> The top store for documents. Each record is a document, a lot like JSON.

**Field:** Software Development  
**Category:** Databases  
**Also known as:** Mongo

## Think of it like

Think of it like a box of folders. Each folder can hold a different mix of papers.

## Definition

MongoDB is the most used document database. It stores each record as a document in a JSON-like format called BSON. Documents are grouped into collections. You query it with its own commands rather than SQL. It can spread data across many servers and keep copies for safety. Its server listens on port 27017 by default.

## Example

Jack's game saves each player's profile and items as one MongoDB document. New item types need no schema change.

## Example code

```javascript
db.players.insertOne({ name: "Jack", level: 7, items: ["sword"] })
db.players.find({ level: { $gt: 5 } })
```

This saves one player, then finds each player above level 5.

## Why it matters

It is the document store you will most likely meet at work.

## Common mistake

Leaving it open to the internet with no password. Thousands of databases have been wiped or stolen this way.

## Three principles

- **Documents in collections.** Like rows in tables.
- **Its own query style.** Commands, not SQL.
- **Spreads out.** Data across many servers.

## Related terms

- [Document Database](https://learn.benibix.com/term/development/document-database)
- [NoSQL Database](https://learn.benibix.com/term/development/nosql-database)
- [JavaScript Object Notation (JSON)](https://learn.benibix.com/term/development/json)
- [Redis](https://learn.benibix.com/term/development/redis)

---

Source: https://learn.benibix.com/term/development/mongodb
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
