mongodb:存储分层树结构吗? [英] mongodb: storing a hierarchical tree structure?

查看:311
本文介绍了mongodb:存储分层树结构吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在mongodb上,我将如何存储分层树数据,其中每个节点都包含一个Java对象,该Java对象包含它自己的一组字符串变量和对象?

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?

如果没有孩子,它将直接进行.但是如何将子节点DBobject作为字段存储在mongodb上?

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

例如在Jtree上,如果用户单击并选择特定节点上的delete,则应该有一些唯一的标识符对应.

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.

p.s.我可以为每个用户创建一个数据库并让mongodb对该用户进行身份验证吗?

p.s. can I create a database for each user and let mongodb authenticate the user?

推荐答案

Kim, 您应该查看此mongodb文章 mongodb中的树.它可能会给您带来一些帮助.

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

这篇关于mongodb:存储分层树结构吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆