1
0
Fork 0
arangodb/Documentation/Examples/RestTraversalVisitorCountAn...

41 lines
1.0 KiB
Plaintext

shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{ "startVertex": "persons/alice", "graphName" : "knows_graph", "direction" : "outbound", "init" : "result.visited = 0; result.myVertices = [ ];", "visitor" : "result.visited++; result.myVertices.push(vertex);"}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
{
"result" : {
"visited" : 4,
"myVertices" : [
{
"_id" : "persons/alice",
"_key" : "alice",
"_rev" : "963834763",
"name" : "Alice"
},
{
"_id" : "persons/bob",
"_key" : "bob",
"_rev" : "964031371",
"name" : "Bob"
},
{
"_id" : "persons/charlie",
"_key" : "charlie",
"_rev" : "964293515",
"name" : "Charlie"
},
{
"_id" : "persons/dave",
"_key" : "dave",
"_rev" : "964490123",
"name" : "Dave"
}
]
},
"error" : false,
"code" : 200
}