ArangoDB v3.4 reached End of Life (EOL) and is no longer supported.
This documentation is outdated. Please see the most recent version here: Latest Docs
HTTP Interface for Traversals
The API endpoint /_api/traversal
is deprecated from version 3.4.0 on.
The preferred way to traverse graphs is with AQL.
ArangoDB’s graph traversals are executed on the server. Traversals can be initiated by clients by sending the traversal description for execution to the server.
Traversals in ArangoDB are used to walk over a graph stored in one edge collection. It can easily be described which edges of the graph should be followed and which actions should be performed on each visited vertex. Furthermore the ordering of visiting the nodes can be specified, for instance depth-first or breadth-first search are offered.
Executing Traversals via HTTP
executes a traversal
execute a server-side traversal
POST /_api/traversal
This route should no longer be used. It is considered as deprecated from version 3.4.0 on. It is superseded by AQL graph traversal.
Request Body
-
startVertex (string, required): id of the startVertex, e.g. “users/foo”.
-
edgeCollection (string, optional): name of the collection that contains the edges.
-
graphName (string, optional): name of the graph that contains the edges. Either edgeCollection or graphName has to be given. In case both values are set the graphName is preferred.
- filter (string, optional):
default is to include all nodes:
body (JavaScript code) of custom filter function
function signature: (config, vertex, path) -> mixed
can return four different string values:
- “exclude” -> this vertex will not be visited.
- “prune” -> the edges of this vertex will not be followed.
- ”” or undefined -> visit the vertex and follow its edges.
- Array -> containing any combination of the above. If there is at least one “exclude” or “prune” respectively is contained, it’s effect will occur.
-
minDepth (string, optional): ANDed with any existing filters): visits only nodes in at least the given depth
-
maxDepth (string, optional): ANDed with any existing filters visits only nodes in at most the given depth
-
visitor (string, optional): body (JavaScript) code of custom visitor function function signature: (config, result, vertex, path, connected) -> void The visitor function can do anything, but its return value is ignored. To populate a result, use the result variable by reference. Note that the connected argument is only populated when the order attribute is set to “preorder-expander”.
- direction (string, optional):
direction for traversal
- if set, must be either “outbound”, “inbound”, or “any”
- if not set, the expander attribute must be specified
-
init (string, optional): body (JavaScript) code of custom result initialization function function signature: (config, result) -> void initialize any values in result with what is required
-
expander (string, optional): body (JavaScript) code of custom expander function must be set if direction attribute is not set function signature: (config, vertex, path) -> array expander must return an array of the connections for vertex each connection is an object with the attributes edge and vertex
-
sort (string, optional): body (JavaScript) code of a custom comparison function for the edges. The signature of this function is (l, r) -> integer (where l and r are edges) and must return -1 if l is smaller than, +1 if l is greater than, and 0 if l and r are equal. The reason for this is the following: The order of edges returned for a certain vertex is undefined. This is because there is no natural order of edges for a vertex with multiple connected edges. To explicitly define the order in which edges on the vertex are followed, you can specify an edge comparator function with this attribute. Note that the value here has to be a string to conform to the JSON standard, which in turn is parsed as function body on the server side. Furthermore note that this attribute is only used for the standard expanders. If you use your custom expander you have to do the sorting yourself within the expander code.
-
strategy (string, optional): traversal strategy can be “depthfirst” or “breadthfirst”
-
order (string, optional): traversal order can be “preorder”, “postorder” or “preorder-expander”
-
itemOrder (string, optional): item iteration order can be “forward” or “backward”
-
uniqueness (string, optional): specifies uniqueness for vertices and edges visited. If set, must be an object like this:
"uniqueness": {"vertices": "none"|"global"|"path", "edges": "none"|"global"|"path"}
- maxIterations (string, optional): Maximum number of iterations in each traversal. This number can be set to prevent endless loops in traversal of cyclic graphs. When a traversal performs as many iterations as the maxIterations value, the traversal will abort with an error. If maxIterations is not set, a server-defined value may be used.
Starts a traversal starting from a given vertex and following. edges contained in a given edgeCollection. The request must contain the following attributes.
If the Traversal is successfully executed HTTP 200 will be returned. Additionally the result object will be returned by the traversal.
For successful traversals, the returned JSON object has the following properties:
-
error: boolean flag to indicate if an error occurred (false in this case)
-
code: the HTTP status code
-
result: the return value of the traversal
If the traversal specification is either missing or malformed, the server will respond with HTTP 400.
The body of the response will then contain a JSON object with additional error details. The object has the following attributes:
-
error: boolean flag to indicate that an error occurred (true in this case)
-
code: the HTTP status code
-
errorNum: the server error number
-
errorMessage: a descriptive error message
Responses
HTTP 200: If the traversal is fully executed HTTP 200 will be returned.
HTTP 400: If the traversal specification is either missing or malformed, the server will respond with HTTP 400.
HTTP 404: The server will responded with HTTP 404 if the specified edge collection does not exist, or the specified start vertex cannot be found.
HTTP 500: The server will responded with HTTP 500 when an error occurs inside the traversal or if a traversal performs more than maxIterations iterations.
Examples
In the following examples the underlying graph will contain five persons Alice, Bob, Charlie, Dave and Eve. We will have the following directed relations:
- Alice knows Bob
- Bob knows Charlie
- Bob knows Dave
- Eve knows Alice
- Eve knows Bob
The starting vertex will always be Alice.
Follow only outbound edges
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNP2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNP6---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNQ----",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNQC---",
"name" : "Dave"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNP2---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "71084",
"_id" : "knows/71084",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNQG---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNP2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNP6---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "71084",
"_id" : "knows/71084",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNQG---",
"vertex" : "alice"
},
{
"_key" : "71086",
"_id" : "knows/71086",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRNQK---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNP2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNP6---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNQ----",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "71084",
"_id" : "knows/71084",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNQG---",
"vertex" : "alice"
},
{
"_key" : "71088",
"_id" : "knows/71088",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRNQK--A",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNP2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNP6---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNQC---",
"name" : "Dave"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Follow only inbound edges
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "inbound"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNH----",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNHK--A",
"name" : "Eve"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNH----",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70890",
"_id" : "knows/70890",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNHW---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNH----",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNHK--A",
"name" : "Eve"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "inbound"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Follow any direction of edges
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "global"
}
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM1C---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM1C--A",
"name" : "Dave"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM1G---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70527",
"_id" : "knows/70527",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM1K---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70527",
"_id" : "knows/70527",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM1K---",
"vertex" : "alice"
},
{
"_key" : "70529",
"_id" : "knows/70529",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRM1O---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM1C---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "70527",
"_id" : "knows/70527",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM1K---",
"vertex" : "alice"
},
{
"_key" : "70531",
"_id" : "knows/70531",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRM1O--A",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM1C--A",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70527",
"_id" : "knows/70527",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM1K---",
"vertex" : "alice"
},
{
"_key" : "70535",
"_id" : "knows/70535",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM1S--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM1G---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70527",
"_id" : "knows/70527",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM1K---",
"vertex" : "alice"
},
{
"_key" : "70535",
"_id" : "knows/70535",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM1S--A",
"vertex" : "eve"
},
{
"_key" : "70533",
"_id" : "knows/70533",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM1S---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM1---_",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM1G---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM06---",
"name" : "Alice"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "global"
}
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Excluding Charlie and Bob
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"filter" : "if (vertex.name === \"Bob\" || vertex.name === \"Charlie\") { return \"exclude\";}return;"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNCm---",
"name" : "Alice"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNCy---",
"name" : "Dave"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNCm---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70793",
"_id" : "knows/70793",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNC2--A",
"vertex" : "alice"
},
{
"_key" : "70797",
"_id" : "knows/70797",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRND----",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNCm---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNCq---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNCy---",
"name" : "Dave"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"filter" : "if (vertex.name === \"Bob\" || vertex.name === \"Charlie\") { return \"exclude\";}return;"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Do not follow edges from Bob
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"filter" : "if (vertex.name === \"Bob\") {return \"prune\";}return;"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNE2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNE2--A",
"name" : "Bob"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNE2---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70841",
"_id" : "knows/70841",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNFG---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNE2---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNE2--A",
"name" : "Bob"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"filter" : "if (vertex.name === \"Bob\") {return \"prune\";}return;"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Visit only nodes in a depth of at least 2
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"minDepth" : 2
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNNq---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNNu---",
"name" : "Dave"
}
],
"paths" : [
{
"edges" : [
{
"_key" : "71036",
"_id" : "knows/71036",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNNy--A",
"vertex" : "alice"
},
{
"_key" : "71038",
"_id" : "knows/71038",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRNN2---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNNi---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNNm---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNNq---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "71036",
"_id" : "knows/71036",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNNy--A",
"vertex" : "alice"
},
{
"_key" : "71040",
"_id" : "knows/71040",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRNN6---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNNi---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNNm---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNNu---",
"name" : "Dave"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"minDepth" : 2
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Visit only nodes in a depth of at most 1
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"maxDepth" : 1
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNJC---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNJG---",
"name" : "Bob"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNJC---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70928",
"_id" : "knows/70928",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNJS---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNJC---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNJG---",
"name" : "Bob"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"maxDepth" : 1
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Using a visitor function to return vertex ids only
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"visitor" : "result.visited.vertices.push(vertex._id);"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
"persons/alice",
"persons/bob",
"persons/charlie",
"persons/dave"
],
"paths" : [ ]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "outbound",
"visitor" : "result.visited.vertices.push(vertex._id);"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Count all visited nodes and return a list of nodes only
shell> curl -X POST --header 'accept: application/json' --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 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : 4,
"myVertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNVu---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNVy---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNVy--A",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNV2---",
"name" : "Dave"
}
]
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --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 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Expand only inbound edges of Alice and outbound edges of Eve
shell> curl -X POST --header 'accept: application/json' --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 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNXy---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNY----",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNX2---",
"name" : "Bob"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNXy---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "71260",
"_id" : "knows/71260",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNYK---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNXy---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNY----",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "71260",
"_id" : "knows/71260",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNYK---",
"vertex" : "eve"
},
{
"_key" : "71262",
"_id" : "knows/71262",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNYO---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNXy---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNY----",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNX2---",
"name" : "Bob"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --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 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Follow the depthfirst strategy
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"strategy" : "depthfirst"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM8C---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM8G---",
"name" : "Dave"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM8C---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM8G---",
"name" : "Dave"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
},
{
"_key" : "70662",
"_id" : "knows/70662",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRM8O---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM8C---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
},
{
"_key" : "70664",
"_id" : "knows/70664",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRM8S---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM8G---",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
},
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
},
{
"_key" : "70662",
"_id" : "knows/70662",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRM8O---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM8C---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
},
{
"_key" : "70664",
"_id" : "knows/70664",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRM8S---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM8G---",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70666",
"_id" : "knows/70666",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM8W---",
"vertex" : "eve"
},
{
"_key" : "70668",
"_id" : "knows/70668",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM8W--A",
"vertex" : "eve"
},
{
"_key" : "70660",
"_id" : "knows/70660",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM8K--A",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM8K---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM8----",
"name" : "Bob"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM76---",
"name" : "Alice"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"strategy" : "depthfirst"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Using postorder ordering
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"order" : "postorder"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNSW---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNSa---",
"name" : "Dave"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNSW---",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNSa---",
"name" : "Dave"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
}
],
"paths" : [
{
"edges" : [
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
},
{
"_key" : "71134",
"_id" : "knows/71134",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRNSi---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNSW---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
},
{
"_key" : "71136",
"_id" : "knows/71136",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRNSm---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNSa---",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
},
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
},
{
"_key" : "71134",
"_id" : "knows/71134",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRNSi---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNSW---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
},
{
"_key" : "71136",
"_id" : "knows/71136",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRNSm---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNSa---",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
},
{
"_key" : "71132",
"_id" : "knows/71132",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNSe---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
},
{
"_key" : "71140",
"_id" : "knows/71140",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNSq--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNSS---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "71138",
"_id" : "knows/71138",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNSq---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNSa--A",
"name" : "Eve"
}
]
},
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNSO---",
"name" : "Alice"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"order" : "postorder"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Using backward item-ordering:
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"itemOrder" : "backward"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM4a--A",
"name" : "Dave"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM4a---",
"name" : "Charlie"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM4a--A",
"name" : "Dave"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM4a---",
"name" : "Charlie"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
},
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
},
{
"_key" : "70590",
"_id" : "knows/70590",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRM4q---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM4a--A",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
},
{
"_key" : "70588",
"_id" : "knows/70588",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRM4m---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM4a---",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
},
{
"_key" : "70594",
"_id" : "knows/70594",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRM4u---",
"vertex" : "eve"
},
{
"_key" : "70592",
"_id" : "knows/70592",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRM4q--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRM4e---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
},
{
"_key" : "70590",
"_id" : "knows/70590",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRM4q---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRM4a--A",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70586",
"_id" : "knows/70586",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRM4i---",
"vertex" : "alice"
},
{
"_key" : "70588",
"_id" : "knows/70588",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRM4m---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRM4S---",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRM4W---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRM4a---",
"name" : "Charlie"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"itemOrder" : "backward"
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
Edges should only be included once globally, but nodes are included every time they are visited
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "global"
}
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"result" : {
"visited" : {
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNAC--A",
"name" : "Charlie"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNAG---",
"name" : "Dave"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNAK---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
}
],
"paths" : [
{
"edges" : [ ],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
}
]
},
{
"edges" : [
{
"_key" : "70734",
"_id" : "knows/70734",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNAK--A",
"vertex" : "alice"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
}
]
},
{
"edges" : [
{
"_key" : "70734",
"_id" : "knows/70734",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNAK--A",
"vertex" : "alice"
},
{
"_key" : "70736",
"_id" : "knows/70736",
"_from" : "persons/bob",
"_to" : "persons/charlie",
"_rev" : "_bHcRNAO---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
},
{
"_key" : "charlie",
"_id" : "persons/charlie",
"_rev" : "_bHcRNAC--A",
"name" : "Charlie"
}
]
},
{
"edges" : [
{
"_key" : "70734",
"_id" : "knows/70734",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNAK--A",
"vertex" : "alice"
},
{
"_key" : "70738",
"_id" : "knows/70738",
"_from" : "persons/bob",
"_to" : "persons/dave",
"_rev" : "_bHcRNAS---",
"vertex" : "bob"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
},
{
"_key" : "dave",
"_id" : "persons/dave",
"_rev" : "_bHcRNAG---",
"name" : "Dave"
}
]
},
{
"edges" : [
{
"_key" : "70734",
"_id" : "knows/70734",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNAK--A",
"vertex" : "alice"
},
{
"_key" : "70742",
"_id" : "knows/70742",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNAW---",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNAK---",
"name" : "Eve"
}
]
},
{
"edges" : [
{
"_key" : "70734",
"_id" : "knows/70734",
"_from" : "persons/alice",
"_to" : "persons/bob",
"_rev" : "_bHcRNAK--A",
"vertex" : "alice"
},
{
"_key" : "70742",
"_id" : "knows/70742",
"_from" : "persons/eve",
"_to" : "persons/bob",
"_rev" : "_bHcRNAW---",
"vertex" : "eve"
},
{
"_key" : "70740",
"_id" : "knows/70740",
"_from" : "persons/eve",
"_to" : "persons/alice",
"_rev" : "_bHcRNAS--A",
"vertex" : "eve"
}
],
"vertices" : [
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
},
{
"_key" : "bob",
"_id" : "persons/bob",
"_rev" : "_bHcRNAC---",
"name" : "Bob"
},
{
"_key" : "eve",
"_id" : "persons/eve",
"_rev" : "_bHcRNAK---",
"name" : "Eve"
},
{
"_key" : "alice",
"_id" : "persons/alice",
"_rev" : "_bHcRNA----",
"name" : "Alice"
}
]
}
]
}
},
"error" : false,
"code" : 200
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "global"
}
}
EOF
HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
If the underlying graph is cyclic, maxIterations should be set
The underlying graph has two vertices Alice and Bob. With the directed edges:
- Alice knows Bob
- Bob knows Alice
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "none"
},
"maxIterations" : 5
}
EOF
HTTP/1.1 Internal Server Error
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
{
"error" : true,
"code" : 500,
"errorNum" : 1909,
"errorMessage" : "too many iterations - try increasing the value of 'maxIterations'"
}
shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/traversal <<EOF
{
"startVertex" : "persons/alice",
"graphName" : "knows_graph",
"direction" : "any",
"uniqueness" : {
"vertices" : "none",
"edges" : "none"
},
"maxIterations" : 5
}
EOF
HTTP/1.1 Internal Server Error
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
All examples were using this graph: