Here is my aql query giving me the pathways to a specific vertex:
FOR v, e, p IN 1..2 OUTBOUND @startVertex GRAPH 'courses'
FILTER v._id == @target
RETURN p.vertices
And it returns something like this
[
[
{
"_key": "ADELPHI+UNIVERSITY==BIO+111",
"_id": "courses/ADELPHI+UNIVERSITY==BIO+111"
},
{
"_key": "BOSTON+UNIVERSITY==CAS+BI+108",
"_id": "courses/BOSTON+UNIVERSITY==CAS+BI+108"
}
],
[
{
"_key": "ADELPHI+UNIVERSITY==BIO+111",
"_id": "courses/ADELPHI+UNIVERSITY==BIO+111"
},
{
"_key": "UNIVERSITY+OF+NEVADA-LAS+VEGAS==BIOL+196",
"_id": "courses/UNIVERSITY+OF+NEVADA-LAS+VEGAS==BIOL+196"
},
{
"_key": "BOSTON+UNIVERSITY==CAS+BI+108",
"_id": "courses/BOSTON+UNIVERSITY==CAS+BI+108"
}
]
]
When I use the FOR
operator and try to iterate through p.vertices
or p.vertices[*]
, it always flattens the array. Essentially I want to go through each array and return something for each.
Just like this python code:
lists = [[], [], []]
for l in lists:
do_something_with_list(l)