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" : "_WpTB-1m--_", "name" : "Alice" }, { "_key" : "eve", "_id" : "persons/eve", "_rev" : "_WpTB-1m--H", "name" : "Eve" }, { "_key" : "bob", "_id" : "persons/bob", "_rev" : "_WpTB-1m--B", "name" : "Bob" } ], "paths" : [ { "edges" : [ ], "vertices" : [ { "_key" : "alice", "_id" : "persons/alice", "_rev" : "_WpTB-1m--_", "name" : "Alice" } ] }, { "edges" : [ { "_key" : "13004", "_id" : "knows/13004", "_from" : "persons/eve", "_to" : "persons/alice", "_rev" : "_WpTB-1q--B", "vertex" : "eve" } ], "vertices" : [ { "_key" : "alice", "_id" : "persons/alice", "_rev" : "_WpTB-1m--_", "name" : "Alice" }, { "_key" : "eve", "_id" : "persons/eve", "_rev" : "_WpTB-1m--H", "name" : "Eve" } ] }, { "edges" : [ { "_key" : "13004", "_id" : "knows/13004", "_from" : "persons/eve", "_to" : "persons/alice", "_rev" : "_WpTB-1q--B", "vertex" : "eve" }, { "_key" : "13007", "_id" : "knows/13007", "_from" : "persons/eve", "_to" : "persons/bob", "_rev" : "_WpTB-1q--D", "vertex" : "eve" } ], "vertices" : [ { "_key" : "alice", "_id" : "persons/alice", "_rev" : "_WpTB-1m--_", "name" : "Alice" }, { "_key" : "eve", "_id" : "persons/eve", "_rev" : "_WpTB-1m--H", "name" : "Eve" }, { "_key" : "bob", "_id" : "persons/bob", "_rev" : "_WpTB-1m--B", "name" : "Bob" } ] } ] } }, "error" : false, "code" : 200 }