|
What is MongoDB?
What are some common MongoDB terms?
Document
.
- Basic unit of data
- Based on objects represented as JSON
- Stored in a binary format BSON
- Can have one or more fields
- Grouped together as collections
- Examples ...
Field
.
- Smallest subdivision within a document
- Analogous to a column in a database table
- Examples ...
Collection
.
- Group of documents
- Like an RDBMS table
- Exists within a mongoDB database
- No fixed/rigid schema: documents can have different fields
- Collections should represent data with a common purpose
- Examples ...
Referencing
.
- Used for 1-to-many relationships
- More efficient storage
- Allows for normalized data structures
- Slower and less efficient to read
- Examples ...
Embedding
.
- Lets you to represent 1-to-1 and 1-to-many relationships
- Allows for de-normalized complex modeling
- Brings in data where it is needed
- "Document Growth" can affect writes and risk fragmentation
- Examples ...
Cursor
.
- Used to iterate through results of a query
- Produced by find()
- Further ops are possible: sort(),limit(),etc.
|
|