Storing Tree Like Hierarchy Structures With MongoDB
Vyacheslav Voronenko expands a bit on the Model tree structures in MongoDB article and provides some code snippets for common operations:
In a real life almost any project deals with the tree structures. Different kinds of taxonomies, site structures etc require modelling of hierarhy relations. In this article I will illustrate using first three of five typical approaches of operateting with hierarchy data on example of the MongoDB database. Those approaches are:
- Model Tree Structures with Child References
- Model Tree Structures with Parent References
- Model Tree Structures with an Array of Ancestors
- Model Tree Structures with Materialized Paths
- Model Tree Structures with Nested Sets
The 2nd part of the article is available here and all the code is on GitHub
Original title and link: Storing Tree Like Hierarchy Structures With MongoDB (©myNoSQL)
via: http://www.codeproject.com/Articles/521713/Storing-Tree-like-Hierarchy-Structures-With-MongoD