0

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.

titzu
  • 51
  • 1
  • 4
  • 1
    New user. Can we please ask you to show what you have tried already in your question and state what your problem is? Surely you are not posting here so that someone can write your code for you, so your specific problem is most appreciated. – Neil Lunn Apr 28 '14 at 14:46
  • Example data along with what you want to achieve will be useful for anyone to suggestion further. – aks Apr 28 '14 at 18:14

0 Answers0