shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"expander" : "var connections = [ ];if (vertex.name === \"Alice\") {config.datasource.getInEdges(vertex).forEach(function (e) {connections.push({ vertex: require(\"internal\").db._document(e._from), edge: e});});}if (vertex.name === \"Eve\") {config.datasource.getOutEdges(vertex).forEach(function (e) {connections.push({vertex: require(\"internal\").db._document(e._to), edge: e});});}return connections;"
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_XiAwTUO--_",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_XiAwTUO--H",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_XiAwTUO--B",
"name" : "Bob"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_XiAwTUO--_",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "13143",
"_id" : "knows/13143",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_XiAwTUS--F",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_XiAwTUO--_",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_XiAwTUO--H",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "13143",
"_id" : "knows/13143",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_XiAwTUS--F",
"vertex" : "eve"
},
{
"_key" : "13146",
"_id" : "knows/13146",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_XiAwTUS--H",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_XiAwTUO--_",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_XiAwTUO--H",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_XiAwTUO--B",
"name" : "Bob"
}
]
}
]
}
},
"error" : false,
"code" : 200
}