I have the following Documents in my MongoDB- database
. This Document represents folders in my UI. A subfolder references to the parent folder over superFolderId.
I will view this tree in my angularJS UI. My question now would be how to store this tree structure in a list in backend in order to kindly show this structure in AngularJS Frontend.
I would be glad of any hint in this direction.
{
"_id" : ObjectId("598c43aa76eba30a8ab373ac"),
"name" : "Folder1",
"created" : ISODate("2017-08-10T11:29:41Z"),
"projectId" : "598c425d76eba30a8ab373a6",
"superFolderId" : "",
}
{
"_id" : ObjectId("598c43b176eba30a8ab373ad"),
"name" : "Folder1_1",
"created" : ISODate("2017-08-10T11:29:49Z"),
"projectId" : "598c425d76eba30a8ab373a6",
"superFolderId" : "598c43aa76eba30a8ab373ac",
}
{
"_id" : ObjectId("598c43f676eba30a8ab373ae"),
"name" : "Folder1_1_1",
"created" : ISODate("2017-08-10T11:30:58Z"),
"projectId" : "598c425d76eba30a8ab373a6",
"superFolderId" : "598c43b176eba30a8ab373ad",
}