Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-24-2020 10:17 PM
I want to store a Bill of materials(BOM) in neo4j. It is a tree schema.
below will be the queries :
I want the output as a tree. In a nested manner.
for e.g:
{
type:"transport",
name:"xyz",
child:[{
type:"airways",
name:"pqr"
},{
type:"waterways",
name:"qwe",
child:
[{
type:"ships",
name:"asd"
},{
type:"sub-marine",
name:"cfv"
},]}}{
type:"roadways",
name:"dffd"
}]}
Solved! Go to Solution.
03-25-2020 01:14 AM
Personally I would do most of these transforms in a different scripting language, but there seem to be an APOC procedure you can use: apoc.convert.toTree
First, you should get acquainted with CYPHER and try fetching the data with queries in the browser, then deal with the output format later...
03-25-2020 12:26 AM
Look at variable length querying
https://neo4j.com/docs/cypher-manual/current/syntax/patterns/#cypher-pattern-varlength
03-25-2020 12:55 AM
Thank you @Thomas_Silkjaer. I am new to neo4j. Can you please help me with a sample query to get the output as nested structure. The number of nested levels(height of the tree) is not known before as the tree is dynamic and nodes can be added or deleted over the time.
03-25-2020 01:14 AM
Personally I would do most of these transforms in a different scripting language, but there seem to be an APOC procedure you can use: apoc.convert.toTree
First, you should get acquainted with CYPHER and try fetching the data with queries in the browser, then deal with the output format later...
All the sessions of the conference are now available online