Parent-reference tree
Reference group: Schema patterns
What it does
Simple writes and direct parent/child lookup.
Syntax
Each node stores parentId
Use case
Categories and organizational charts.
Parent-reference tree: practical example
{ _id: categoryId, name: "MongoDB", parentId: parentCategoryId }💡 Explanation
Simple writes and direct parent/child lookup.
When to use it
Categories and organizational charts.
Key Takeaways
- Simple writes and direct parent/child lookup.
- Typical use: Categories and organizational charts.