问题 I want to build a hierarchical data structure from my sql query. After following this post for build hierarchical JSON object from flat objects, I try to create 4 level hierarchy with more attributes in object levels, but don't need children property. How can i do this? Here is my JavaScript (NodeJS) code: var levels = ["counties_id","district_id", "municipalities_id", "institutes_id"]; data.forEach(function(d){ var depthCursor = newData.counties; levels.forEach(function( property, depth ){