2
Любая идея моделирования модели дерева в схеме Mongoose?Рекурсивные элементы в схеме: моделирование Mongoose
var TreeSchema = new Schema({
"Non-leafNode" : { 'children': [ { type: "NodeElement"}], 'title': String},
"NodeElement: { 'elem':{ type: "LeafNode"}, 'elem2':{ type: "Non-leafNode" }}, // one of them is required. not both.
"LeafNode" : { title : String}
});
Как можно моделировать это? Все Дерево один документ (в идеале)