🗃️MongoDB
Also known as Mongo
The top store for documents. Each record is a document, a lot like JSON.
Think of it like
Think of it like a box of folders. Each folder can hold a different mix of papers.
Example
Jack's game saves each player's profile and items as one MongoDB document. New item types need no schema change.
Why it matters
It is the document store you will most likely meet at work.
Definition
Example code
javascript
db.players.insertOne({ name: "Jack", level: 7, items: ["sword"] })
db.players.find({ level: { $gt: 5 } })Common mistake
Key takeaways
- 1Documents in collections. Like rows in tables.
- 2Its own query style. Commands, not SQL.
- 3Spreads out. Data across many servers.