I want to store a filesystem tree into MongoDB within a Ruby application, so we are talking about json/bson representation of something like:
/
/foo
/foo/one
/foo/bar/two
/foo/bar/three
/four
my aim is to store it efficiently and to serve it via json to an Adobe Flex application which will display it in a Tree component.
which is the best solution in your opinion?
this document suggests some options.
i'd like to go for something like the first pattern (keeping in mind the limit of 16Mb document size) with this format:
{"/" => [{"foo" => ["one", {"bar" => ["two", "three"]}]}, "four"]}
what do you think? is this a good format to store a hierarchical filesystem tree?
any suggestion is appreciated.