I need to mimic a directory structure in mongodb. I have read about materialized paths pattern and this is the one I need to use
http://docs.mongodb.org/manual/tutorial/model-tree-structures/ The Materialized Paths pattern stores each tree node in a document; in addition to the tree node, document stores as a string the id(s) of the node’s ancestors or path.
The problem with this is that _id needs to be unique but the directory name in my case should support duplicates (you can have 2 ore more directories with the same name).
Any ideas? Thanks.