I'm trying to obtain the shortest path between two nodes in a graph using the dijkstra algorithm in Orientdb, using javascript. My output looks like below. I would like to know the length of the result (no of nodes) and print the properties of the edge between the consecutive nodes.
Unfortunately, I'm unable to find the correct length (always returns 1) and access the name/@rid (like #15:0,#15:4 etc) of each node. Can you please help me on how can I do it? Thanks.
result = db.query("SELECT dijkstra((select from destination where location ='A'),(select from destination where location ='B'), 'length','out')");
[
{
"@type": "d",
"@rid": "#-2:1",
"@version": 0,
"dijkstra": [
"#15:0",
"#15:4",
"#15:2"
],
"@fieldTypes": "dijkstra=z"
}
]