I'm new to both ArangoDB and Graph based traversal query.
Here is how my graph is currently structured. Each vertex will have atleast one attributes(key-value pair). You can think of it has a dependency tree. Every parent node(with its own properties) is dependent on child node(again with its own properties). There is no inheritance just relation of parent to child.
Lets say for this example:
vertex1 has { key1: value1 }
vertex2 has { key2 : value2, key3: value3 }
vertex3 has { key4 : value4 }
vertex4 has { key5 : value5 }
I've figured out the basic graph traversal from the docs however I have a specific requirement structuring the RETURNed object structure based on the vertices present(visited) starting from vertex1 till the maxDepth.
RETURN object must have following structure: as you can see as the vertex depth increases the object gets nested under the parent node.
{
vertex1: {
key1:value1
vertex2: {
key2:value2,
key3:value3,
vertex3: {
key4:value4
}
}
vertex4: {
key5:value5
}
}
}
I can't ask you to write the query for me but any help is much appreciated and would set me in the right direction.
Based on my current understanding:
FOR v IN 1..2 OUTBOUND 'vertex1' GRAPH 'grapgName'
//I'm guessing I would have to COLLECT and GROUP
//on the existing vertex to projected object structure.
//I just don't know how :(
RETURN returnObj
Let me know if you need additional info
