Hi everyone I’m actually on a gantt diagram and I have to work on a Tree style hyerarchy on my mongo collection to be able to move any tasks inside any other tasks and to have multiple level child/mother relations without any limits… It have to be easy to update or move any node so I though that a typical Tree style could perform pretty well
So this is actually what I have on my mockup :
Tasks collection
{
{ "_id" : "y9bi6GEEjfaKJyDNr", "name" : "PRoject 1", "personnage" ... }
{ "_id" : "TY6prrpfwryTug8fr", "name" : "PRoject 2", "personnage" : "aggg", "quantity" : 36, ... }
{ "_id" : "JdxJo2ghrzBCBYfiT", "name" : "PRoject 3", "personnage" : "agd", "quantity" : 29, ...}
}
This is what I would like to have :
New tasks collection experimental mapping
{
'tree': {
{"_id": "y9bi6GEEjfaKJyDNr", "number_of_childs" : 0, "childs": ""}
{"_id": "TY6prrpfwryTug8fr", "number_of_childs" : 0, "childs": ""}
{"_id": "JdxJo2ghrzBCBYfiT",
"number_of_childs" : 3,
"childs": { {"_id": "FSet4LQRqAwSLyqRA", "number_of_childs" : 0, "childs": ""}
{"_id": "hMDCw5bgvHrkzqJ94"
"number_of_childs" : 1
"childs": {"_id": "kvfXpmkd7zu9K38Qv""number_of_childs" : 0,"childs": ""} }
}
{"_id": "YbYuaoCqGkD72cJz4", "number_of_childs" : 0, "childs": ""}
{"_id": "WaJeidMGDMmgma9gT", "number_of_childs" : 0, "childs": ""}
{"_id": "vPLhPa7GQNiCEWrhd","number_of_childss" : 0,"childs": ""}
{"_id": "YDRknrt3tyYnG3Kd7",
"number_of_childs" : 2,
"childs": {"_id": "SKK3zqHbirkN3xaQZ","number_of_childss" : 0,"childs": ""}
{"_id": "rd9gj44jbqoDFnJGt","number_of_childs" : 0,"childs": ""}
}
},
"tasks":{
{ "_id" : "y9bi6GEEjfaKJyDNr", "name" : "PRoject 1", "personnage" ... }
{ "_id" : "TY6prrpfwryTug8fr", "name" : "PRoject 2", "personnage" : "aggg", "quantity" : 36, ... }
{ "_id" : "JdxJo2ghrzBCBYfiT", "name" : "PRoject 3", "personnage" : "agd", "quantity" : 29, ...}
....
}
}
So I would like to map the Tree in a sperate sub Collection, I’m new on the world of noSql database so I’m a little confused.
What do you think of my idea? The fact that there is a non duplicable ID at each lvl make it easier to manage.
But how the insert and update Meteor methods will look like with mutiple lvl sub collections? Is it possible to have this? My brain cannot see out of the picture for now