Getting Started
What is MongoDB?
Install / Config
C.R.U.D. Ops
Data Modeling
Database Mgmt
Data Modeling
One to Many Relationships: Embedded Approach
What is an "embedded" document?
.
If you think of a document as an object:
an embedded document is an object within an object
Example:
{name:"Joe",address:
{street:"Main St.",city:"New York"}}
How do you store data using the "embedded" approach?
.
Group the data to be embedded in a child document X
Add a field Y in the parent document
Assign the child document X to the field Y
How would you query info contained in the embedded document?
.
db.collection.find({"parent_field.child_field":value})
+
o
-