Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 935 Bytes

mongodb.md

File metadata and controls

33 lines (25 loc) · 935 Bytes

MongoDB

  • 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

Advantages

  • Easy Schema Iteration
  • Scalability & Performance
  • Object Oriented

Commands

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