-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MENUS: Merge navigation.menus and navigation.items collections? #10
Comments
the way that I would think of a mongo menu system would work would me there On Wed, Dec 18, 2013 at 9:30 AM, Rafael Diaz-Tushman <
|
I had considered that, but came to the conclusion that embedding the entire tree in one document limits the searchability of the menu tree and restricts any future features associated with menu items (since each menu item wouldn't have a unique identifier). Reordering submenu items also becomes a complicated exercise. Take a look at these tree structures: http://docs.mongodb.org/manual/tutorial/model-tree-structures/ I chose to use the Nested Set while also adding the Materialized Path (the MP makes it remarkably easy to enforce uniqueness). Site menu trees don't change that often (except during build out) and they're easy to work with (though you touch lots of documents each time you move/insert a document) so the Nested Set seemed ideal. For the generic Categories model, I used Materialized Path alone. |
Edit: for the generic Categories model, I used Materialized Path and the Array of Ancestors (makes breadcrumbs really easy, e.g.). |
Cool sounds interesting. This is cool to learn all this new stuff, because instead of learning some Learning in-depth Mongo, and advanced php features is much more interesting Chris On Wed, Dec 18, 2013 at 2:09 PM, Rafael Diaz-Tushman <
|
I can't think of a good reason to have two collections. navigation.menus is currently just the top-level items in navigation.items
The text was updated successfully, but these errors were encountered: