- Uses documents, a collection (instead of tables as in relational database)
- A document is a record in a MongoDB collection and the basic unit of data
- It look like JSON object but exist as BSON
- Collection
- A grouping of MongoDB documents
- All documents in a collection have a similar or related purpose
- Non-relational database (NoSQL)
MySQL | MongoDB |
---|---|
Table | Collection |
Row | Document |
Column | Field |
Joins | Embedded documents, linking |
- Easy Schema Iteration
- Scalability & Performance
- Object Oriented
Command | Description |
---|---|
show collections |
Print a list of all collections for current database |
use <db> |
Switch current database to . The mongo shell variable db is set to the current database |
show dbs |
Print a list of all databases on the server |
More commands here