简体   繁体   中英

mongodb: storing a hierarchical tree structure?

on the mongodb, how would I go about storing a hierarchical tree data in which each node contains a Java object containing it's own set of string variables and objects?

If there were no children, it would straight forward. but how would you store a child node DBobject as a field on the mongodb?

for example on a Jtree, if a user clicks and selects delete on a specific node, there should be some unique identifier that would correspond.

ps can I create a database for each user and let mongodb authenticate the user?

Kim, You should check out this mongodb article Trees in mongodb . It might give you some lead.

The document model is JSon so that is a tree structure in itself. You also have option of embedded (arbitrary) links between docs; naturally you can compose a directed graph of documents linking to one another.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM