1
0
Fork 0
arangodb/js/apps/system/aardvark/api-docs/traversal.json

47 lines
93 KiB
JSON

{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "If the traversal is fully executed <em>HTTP 200</em> will be returned. ",
"code": "200"
},
{
"reason": "If the traversal specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. ",
"code": "400"
},
{
"reason": "The server will responded with <em>HTTP 404</em> if the specified edge collection does not exist, or the specified start vertex cannot be found. ",
"code": "404"
},
{
"reason": "The server will responded with <em>HTTP 500</em> when an error occurs inside the traversal or if a traversal performs more than <em>maxIterations</em> iterations. ",
"code": "500"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "body",
"required": "true",
"name": "body",
"description": ""
}
],
"notes": "Starts a traversal starting from a given vertex and following. edges contained in a given edgeCollection. The request must contain the following attributes. <br><br>- <em>startVertex</em>: id of the startVertex, e.g. <em>\"users/foo\"</em>.<br><br>- <em>edgeCollection</em>: name of the collection that contains the edges.<br><br>- <em>filter</em> (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: - <em>\"exclude\"</em> -> this vertex will not be visited. - <em>\"prune\"</em> -> the edges of this vertex will not be followed. - <em>\"\"</em> or <em>undefined</em> -> visit the vertex and follow it's edges. - <em>Array</em> -> containing any combination of the above. If there is at least one <em>\"exclude\"</em> or <em>\"prune\"</em> respectivly is contained, it's effect will occur. - <em>minDepth</em> (optional, ANDed with any existing filters): visits only nodes in at least the given depth - <em>maxDepth</em> (optional, ANDed with any existing filters): visits only nodes in at most the given depth - <em>visitor</em> (optional): body (JavaScript) code of custom visitor function function signature: (config, result, vertex, path) -> void visitor function can do anything, but its return value is ignored. To populate a result, use the <em>result</em> variable by reference - <em>direction</em> (optional): direction for traversal - *if set*, must be either <em>\"outbound\"</em>, <em>\"inbound\"</em>, or <em>\"any\"</em> - *if not set*, the <em>expander</em> attribute must be specified - <em>init</em> (optional): body (JavaScript) code of custom result initialisation function function signature: (config, result) -> void initialise any values in result with what is required - <em>expander</em> (optional): body (JavaScript) code of custom expander function *must* be set if <em>direction</em> attribute is *not* set function signature: (config, vertex, path) -> array expander must return an array of the connections for <em>vertex</em> each connection is an object with the attributes <em>edge</em> and <em>vertex</em> - <em>strategy</em> (optional): traversal strategy can be <em>\"depthfirst\"</em> or <em>\"breadthfirst\"</em> - <em>order</em> (optional): traversal order can be <em>\"preorder\"</em> or <em>\"postorder\"</em> - <em>itemOrder</em> (optional): item iteration order can be <em>\"forward\"</em> or <em>\"backward\"</em> - <em>uniqueness</em> (optional): specifies uniqueness for vertices and edges visited if set, must be an object like this: <em>\"uniqueness\": {\"vertices\": \"none\"|\"global\"|path\", \"edges\": \"none\"|\"global\"|\"path\"}</em> - <em>maxIterations</em> (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 <em>maxIterations</em> value, the traversal will abort with an error. If <em>maxIterations</em> is not set, a server-defined value may be used. <br><br><br><br>If the Traversal is successfully executed <em>HTTP 200</em> will be returned. Additionally the <em>result</em> object will be returned by the traversal. <br><br>For successful traversals, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate if an error occurred (<em>false</em> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>- <em>result</em>: the return value of the traversal<br><br>If the traversal specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. <br><br>The body of the response will then contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
"summary": "executes a traversal",
"httpMethod": "POST",
"examples": "In the following examples the underlying graph will contain five persons <em>Alice</em>, <em>Bob</em>, <em>Charlie</em>, <em>Dave</em> and <em>Eve</em>. We will have the following directed relations: - <em>Alice</em> knows <em>Bob</em> - <em>Bob</em> knows <em>Charlie</em> - <em>Bob</em> knows <em>Dave</em> - <em>Eve</em> knows <em>Alice</em> - <em>Eve</em> knows <em>Bob</em> The starting vertex will always be Alice. Follow only outbound edges: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/273176907\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/273176907\", \n \"_rev\" : \"273176907\", \n \"_key\" : \"273176907\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/273439051\", \n \"_rev\" : \"273439051\", \n \"_key\" : \"273439051\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/273701195\", \n \"_rev\" : \"273701195\", \n \"_key\" : \"273701195\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/273897803\", \n \"_rev\" : \"273897803\", \n \"_key\" : \"273897803\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/273176907\", \n \"_rev\" : \"273176907\", \n \"_key\" : \"273176907\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/274356555\", \n \"_rev\" : \"274356555\", \n \"_key\" : \"274356555\", \n \"_from\" : \"persons/273176907\", \n \"_to\" : \"persons/273439051\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/273176907\", \n \"_rev\" : \"273176907\", \n \"_key\" : \"273176907\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/273439051\", \n \"_rev\" : \"273439051\", \n \"_key\" : \"273439051\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/274356555\", \n \"_rev\" : \"274356555\", \n \"_key\" : \"274356555\", \n \"_from\" : \"persons/273176907\", \n \"_to\" : \"persons/273439051\" \n }, \n { \n \"_id\" : \"knows/274618699\", \n \"_rev\" : \"274618699\", \n \"_key\" : \"274618699\", \n \"_from\" : \"persons/273439051\", \n \"_to\" : \"persons/273701195\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/273176907\", \n \"_rev\" : \"273176907\", \n \"_key\" : \"273176907\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/273439051\", \n \"_rev\" : \"273439051\", \n \"_key\" : \"273439051\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/273701195\", \n \"_rev\" : \"273701195\", \n \"_key\" : \"273701195\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/274356555\", \n \"_rev\" : \"274356555\", \n \"_key\" : \"274356555\", \n \"_from\" : \"persons/273176907\", \n \"_to\" : \"persons/273439051\" \n }, \n { \n \"_id\" : \"knows/274815307\", \n \"_rev\" : \"274815307\", \n \"_key\" : \"274815307\", \n \"_from\" : \"persons/273439051\", \n \"_to\" : \"persons/273897803\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/273176907\", \n \"_rev\" : \"273176907\", \n \"_key\" : \"273176907\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/273439051\", \n \"_rev\" : \"273439051\", \n \"_key\" : \"273439051\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/273897803\", \n \"_rev\" : \"273897803\", \n \"_key\" : \"273897803\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Follow only inbound edges: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/277698891\", \"edgeCollection\" : \"knows\", \"direction\" : \"inbound\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/277698891\", \n \"_rev\" : \"277698891\", \n \"_key\" : \"277698891\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/278616395\", \n \"_rev\" : \"278616395\", \n \"_key\" : \"278616395\", \n \"name\" : \"Eve\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/277698891\", \n \"_rev\" : \"277698891\", \n \"_key\" : \"277698891\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/279533899\", \n \"_rev\" : \"279533899\", \n \"_key\" : \"279533899\", \n \"_from\" : \"persons/278616395\", \n \"_to\" : \"persons/277698891\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/277698891\", \n \"_rev\" : \"277698891\", \n \"_key\" : \"277698891\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/278616395\", \n \"_rev\" : \"278616395\", \n \"_key\" : \"278616395\", \n \"name\" : \"Eve\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Follow any direction of edges: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/281958731\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"uniqueness\":{\"vertices\":\"none\",\"edges\":\"global\"}}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/282220875\", \n \"_rev\" : \"282220875\", \n \"_key\" : \"282220875\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282483019\", \n \"_rev\" : \"282483019\", \n \"_key\" : \"282483019\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/282679627\", \n \"_rev\" : \"282679627\", \n \"_key\" : \"282679627\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/283793739\", \n \"_rev\" : \"283793739\", \n \"_key\" : \"283793739\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/281958731\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/283793739\", \n \"_rev\" : \"283793739\", \n \"_key\" : \"283793739\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/281958731\" \n }, \n { \n \"_id\" : \"knows/283990347\", \n \"_rev\" : \"283990347\", \n \"_key\" : \"283990347\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/282220875\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/282220875\", \n \"_rev\" : \"282220875\", \n \"_key\" : \"282220875\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/283793739\", \n \"_rev\" : \"283793739\", \n \"_key\" : \"283793739\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/281958731\" \n }, \n { \n \"_id\" : \"knows/283990347\", \n \"_rev\" : \"283990347\", \n \"_key\" : \"283990347\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/282220875\" \n }, \n { \n \"_id\" : \"knows/283138379\", \n \"_rev\" : \"283138379\", \n \"_key\" : \"283138379\", \n \"_from\" : \"persons/281958731\", \n \"_to\" : \"persons/282220875\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/282220875\", \n \"_rev\" : \"282220875\", \n \"_key\" : \"282220875\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/283793739\", \n \"_rev\" : \"283793739\", \n \"_key\" : \"283793739\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/281958731\" \n }, \n { \n \"_id\" : \"knows/283990347\", \n \"_rev\" : \"283990347\", \n \"_key\" : \"283990347\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/282220875\" \n }, \n { \n \"_id\" : \"knows/283400523\", \n \"_rev\" : \"283400523\", \n \"_key\" : \"283400523\", \n \"_from\" : \"persons/282220875\", \n \"_to\" : \"persons/282483019\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/282220875\", \n \"_rev\" : \"282220875\", \n \"_key\" : \"282220875\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/282483019\", \n \"_rev\" : \"282483019\", \n \"_key\" : \"282483019\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/283793739\", \n \"_rev\" : \"283793739\", \n \"_key\" : \"283793739\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/281958731\" \n }, \n { \n \"_id\" : \"knows/283990347\", \n \"_rev\" : \"283990347\", \n \"_key\" : \"283990347\", \n \"_from\" : \"persons/282876235\", \n \"_to\" : \"persons/282220875\" \n }, \n { \n \"_id\" : \"knows/283597131\", \n \"_rev\" : \"283597131\", \n \"_key\" : \"283597131\", \n \"_from\" : \"persons/282220875\", \n \"_to\" : \"persons/282679627\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/281958731\", \n \"_rev\" : \"281958731\", \n \"_key\" : \"281958731\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/282876235\", \n \"_rev\" : \"282876235\", \n \"_key\" : \"282876235\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/282220875\", \n \"_rev\" : \"282220875\", \n \"_key\" : \"282220875\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/282679627\", \n \"_rev\" : \"282679627\", \n \"_key\" : \"282679627\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Excluding <em>Charlie</em> and <em>Bob</em>: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/287201611\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\", \"filter\" : \"if (vertex.name === \\\"Bob\\\" || vertex.name === \\\"Charlie\\\") {return \\\"exclude\\\";}return;\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/287201611\", \n \"_rev\" : \"287201611\", \n \"_key\" : \"287201611\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/287922507\", \n \"_rev\" : \"287922507\", \n \"_key\" : \"287922507\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/287201611\", \n \"_rev\" : \"287201611\", \n \"_key\" : \"287201611\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/288381259\", \n \"_rev\" : \"288381259\", \n \"_key\" : \"288381259\", \n \"_from\" : \"persons/287201611\", \n \"_to\" : \"persons/287463755\" \n }, \n { \n \"_id\" : \"knows/288840011\", \n \"_rev\" : \"288840011\", \n \"_key\" : \"288840011\", \n \"_from\" : \"persons/287463755\", \n \"_to\" : \"persons/287922507\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/287201611\", \n \"_rev\" : \"287201611\", \n \"_key\" : \"287201611\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/287463755\", \n \"_rev\" : \"287463755\", \n \"_key\" : \"287463755\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/287922507\", \n \"_rev\" : \"287922507\", \n \"_key\" : \"287922507\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Do not follow edges from <em>Bob</em>: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/291723595\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\", \"filter\" : \"if (vertex.name === \\\"Bob\\\") {return \\\"prune\\\";}return;\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/291723595\", \n \"_rev\" : \"291723595\", \n \"_key\" : \"291723595\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/291985739\", \n \"_rev\" : \"291985739\", \n \"_key\" : \"291985739\", \n \"name\" : \"Bob\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/291723595\", \n \"_rev\" : \"291723595\", \n \"_key\" : \"291723595\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/292903243\", \n \"_rev\" : \"292903243\", \n \"_key\" : \"292903243\", \n \"_from\" : \"persons/291723595\", \n \"_to\" : \"persons/291985739\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/291723595\", \n \"_rev\" : \"291723595\", \n \"_key\" : \"291723595\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/291985739\", \n \"_rev\" : \"291985739\", \n \"_key\" : \"291985739\", \n \"name\" : \"Bob\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Visit only nodes in a depth of at least 2: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/295917899\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\", \"minDepth\" : 2}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/296442187\", \n \"_rev\" : \"296442187\", \n \"_key\" : \"296442187\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/296638795\", \n \"_rev\" : \"296638795\", \n \"_key\" : \"296638795\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/297097547\", \n \"_rev\" : \"297097547\", \n \"_key\" : \"297097547\", \n \"_from\" : \"persons/295917899\", \n \"_to\" : \"persons/296180043\" \n }, \n { \n \"_id\" : \"knows/297359691\", \n \"_rev\" : \"297359691\", \n \"_key\" : \"297359691\", \n \"_from\" : \"persons/296180043\", \n \"_to\" : \"persons/296442187\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/295917899\", \n \"_rev\" : \"295917899\", \n \"_key\" : \"295917899\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/296180043\", \n \"_rev\" : \"296180043\", \n \"_key\" : \"296180043\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/296442187\", \n \"_rev\" : \"296442187\", \n \"_key\" : \"296442187\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/297097547\", \n \"_rev\" : \"297097547\", \n \"_key\" : \"297097547\", \n \"_from\" : \"persons/295917899\", \n \"_to\" : \"persons/296180043\" \n }, \n { \n \"_id\" : \"knows/297556299\", \n \"_rev\" : \"297556299\", \n \"_key\" : \"297556299\", \n \"_from\" : \"persons/296180043\", \n \"_to\" : \"persons/296638795\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/295917899\", \n \"_rev\" : \"295917899\", \n \"_key\" : \"295917899\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/296180043\", \n \"_rev\" : \"296180043\", \n \"_key\" : \"296180043\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/296638795\", \n \"_rev\" : \"296638795\", \n \"_key\" : \"296638795\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Visit only nodes in a depth of at most 1: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/300439883\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\", \"maxDepth\" : 1}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/300439883\", \n \"_rev\" : \"300439883\", \n \"_key\" : \"300439883\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/300702027\", \n \"_rev\" : \"300702027\", \n \"_key\" : \"300702027\", \n \"name\" : \"Bob\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/300439883\", \n \"_rev\" : \"300439883\", \n \"_key\" : \"300439883\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/301619531\", \n \"_rev\" : \"301619531\", \n \"_key\" : \"301619531\", \n \"_from\" : \"persons/300439883\", \n \"_to\" : \"persons/300702027\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/300439883\", \n \"_rev\" : \"300439883\", \n \"_key\" : \"300439883\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/300702027\", \n \"_rev\" : \"300702027\", \n \"_key\" : \"300702027\", \n \"name\" : \"Bob\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Count all visited nodes and return a list of nodes only: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{ \"startVertex\": \"persons/304634187\", \"edgeCollection\" : \"knows\", \"direction\" : \"outbound\", \"init\" : \"result.visited = 0; result.myVertices = [ ];\", \"visitor\" : \"result.visited++; result.myVertices.push(vertex);\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : 4, \n \"myVertices\" : [ \n { \n \"_id\" : \"persons/304634187\", \n \"_rev\" : \"304634187\", \n \"_key\" : \"304634187\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/304896331\", \n \"_rev\" : \"304896331\", \n \"_key\" : \"304896331\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/305158475\", \n \"_rev\" : \"305158475\", \n \"_key\" : \"305158475\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/305355083\", \n \"_rev\" : \"305355083\", \n \"_key\" : \"305355083\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Expand only inbound edges of <em>Alice</em> and outbound edges of <em>Eve</em>: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/308894027\",\"edgeCollection\":\"knows\",\"expander\":\"var connections = [ ];if (vertex.name === \\\"Alice\\\") {config.edgeCollection.inEdges(vertex).forEach(function (e) {connections.push({ vertex: require(\\\"internal\\\").db._document(e._from), edge: e});});}if (vertex.name === \\\"Eve\\\") {config.edgeCollection.outEdges(vertex).forEach(function (e) {connections.push({vertex: require(\\\"internal\\\").db._document(e._to), edge: e});});}return connections;\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/308894027\", \n \"_rev\" : \"308894027\", \n \"_key\" : \"308894027\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/309811531\", \n \"_rev\" : \"309811531\", \n \"_key\" : \"309811531\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/309156171\", \n \"_rev\" : \"309156171\", \n \"_key\" : \"309156171\", \n \"name\" : \"Bob\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/308894027\", \n \"_rev\" : \"308894027\", \n \"_key\" : \"308894027\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/310729035\", \n \"_rev\" : \"310729035\", \n \"_key\" : \"310729035\", \n \"_from\" : \"persons/309811531\", \n \"_to\" : \"persons/308894027\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/308894027\", \n \"_rev\" : \"308894027\", \n \"_key\" : \"308894027\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/309811531\", \n \"_rev\" : \"309811531\", \n \"_key\" : \"309811531\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/310729035\", \n \"_rev\" : \"310729035\", \n \"_key\" : \"310729035\", \n \"_from\" : \"persons/309811531\", \n \"_to\" : \"persons/308894027\" \n }, \n { \n \"_id\" : \"knows/310925643\", \n \"_rev\" : \"310925643\", \n \"_key\" : \"310925643\", \n \"_from\" : \"persons/309811531\", \n \"_to\" : \"persons/309156171\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/308894027\", \n \"_rev\" : \"308894027\", \n \"_key\" : \"308894027\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/309811531\", \n \"_rev\" : \"309811531\", \n \"_key\" : \"309811531\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/309156171\", \n \"_rev\" : \"309156171\", \n \"_key\" : \"309156171\", \n \"name\" : \"Bob\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Follow the <em>depthfirst</em> strategy: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/313284939\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"strategy\":\"depthfirst\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313809227\", \n \"_rev\" : \"313809227\", \n \"_key\" : \"313809227\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/314005835\", \n \"_rev\" : \"314005835\", \n \"_key\" : \"314005835\", \n \"name\" : \"Dave\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313809227\", \n \"_rev\" : \"313809227\", \n \"_key\" : \"313809227\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/314005835\", \n \"_rev\" : \"314005835\", \n \"_key\" : \"314005835\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/314726731\", \n \"_rev\" : \"314726731\", \n \"_key\" : \"314726731\", \n \"_from\" : \"persons/313547083\", \n \"_to\" : \"persons/313809227\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/313809227\", \n \"_rev\" : \"313809227\", \n \"_key\" : \"313809227\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/314923339\", \n \"_rev\" : \"314923339\", \n \"_key\" : \"314923339\", \n \"_from\" : \"persons/313547083\", \n \"_to\" : \"persons/314005835\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/314005835\", \n \"_rev\" : \"314005835\", \n \"_key\" : \"314005835\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/315316555\", \n \"_rev\" : \"315316555\", \n \"_key\" : \"315316555\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/315119947\", \n \"_rev\" : \"315119947\", \n \"_key\" : \"315119947\", \n \"_from\" : \"persons/314202443\", \n \"_to\" : \"persons/313284939\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/314202443\", \n \"_rev\" : \"314202443\", \n \"_key\" : \"314202443\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/314726731\", \n \"_rev\" : \"314726731\", \n \"_key\" : \"314726731\", \n \"_from\" : \"persons/313547083\", \n \"_to\" : \"persons/313809227\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/313809227\", \n \"_rev\" : \"313809227\", \n \"_key\" : \"313809227\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/314464587\", \n \"_rev\" : \"314464587\", \n \"_key\" : \"314464587\", \n \"_from\" : \"persons/313284939\", \n \"_to\" : \"persons/313547083\" \n }, \n { \n \"_id\" : \"knows/314923339\", \n \"_rev\" : \"314923339\", \n \"_key\" : \"314923339\", \n \"_from\" : \"persons/313547083\", \n \"_to\" : \"persons/314005835\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/313284939\", \n \"_rev\" : \"313284939\", \n \"_key\" : \"313284939\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/313547083\", \n \"_rev\" : \"313547083\", \n \"_key\" : \"313547083\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/314005835\", \n \"_rev\" : \"314005835\", \n \"_key\" : \"314005835\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using <em>postorder</em> ordering: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/319510859\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"order\":\"postorder\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320035147\", \n \"_rev\" : \"320035147\", \n \"_key\" : \"320035147\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/320231755\", \n \"_rev\" : \"320231755\", \n \"_key\" : \"320231755\", \n \"name\" : \"Dave\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/320035147\", \n \"_rev\" : \"320035147\", \n \"_key\" : \"320035147\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/320231755\", \n \"_rev\" : \"320231755\", \n \"_key\" : \"320231755\", \n \"name\" : \"Dave\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/320952651\", \n \"_rev\" : \"320952651\", \n \"_key\" : \"320952651\", \n \"_from\" : \"persons/319773003\", \n \"_to\" : \"persons/320035147\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320035147\", \n \"_rev\" : \"320035147\", \n \"_key\" : \"320035147\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/321149259\", \n \"_rev\" : \"321149259\", \n \"_key\" : \"321149259\", \n \"_from\" : \"persons/319773003\", \n \"_to\" : \"persons/320231755\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320231755\", \n \"_rev\" : \"320231755\", \n \"_key\" : \"320231755\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/321345867\", \n \"_rev\" : \"321345867\", \n \"_key\" : \"321345867\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319510859\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/321542475\", \n \"_rev\" : \"321542475\", \n \"_key\" : \"321542475\", \n \"_from\" : \"persons/320428363\", \n \"_to\" : \"persons/319773003\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320428363\", \n \"_rev\" : \"320428363\", \n \"_key\" : \"320428363\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/320952651\", \n \"_rev\" : \"320952651\", \n \"_key\" : \"320952651\", \n \"_from\" : \"persons/319773003\", \n \"_to\" : \"persons/320035147\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320035147\", \n \"_rev\" : \"320035147\", \n \"_key\" : \"320035147\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n }, \n { \n \"_id\" : \"knows/321149259\", \n \"_rev\" : \"321149259\", \n \"_key\" : \"321149259\", \n \"_from\" : \"persons/319773003\", \n \"_to\" : \"persons/320231755\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/320231755\", \n \"_rev\" : \"320231755\", \n \"_key\" : \"320231755\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/320690507\", \n \"_rev\" : \"320690507\", \n \"_key\" : \"320690507\", \n \"_from\" : \"persons/319510859\", \n \"_to\" : \"persons/319773003\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/319773003\", \n \"_rev\" : \"319773003\", \n \"_key\" : \"319773003\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/319510859\", \n \"_rev\" : \"319510859\", \n \"_key\" : \"319510859\", \n \"name\" : \"Alice\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using <em>backward</em> item-ordering: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/325736779\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"itemOrder\":\"backward\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326457675\", \n \"_rev\" : \"326457675\", \n \"_key\" : \"326457675\", \n \"name\" : \"Dave\" \n }, \n { \n \"_id\" : \"persons/326261067\", \n \"_rev\" : \"326261067\", \n \"_key\" : \"326261067\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326457675\", \n \"_rev\" : \"326457675\", \n \"_key\" : \"326457675\", \n \"name\" : \"Dave\" \n }, \n { \n \"_id\" : \"persons/326261067\", \n \"_rev\" : \"326261067\", \n \"_key\" : \"326261067\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327375179\", \n \"_rev\" : \"327375179\", \n \"_key\" : \"327375179\", \n \"_from\" : \"persons/325998923\", \n \"_to\" : \"persons/326457675\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326457675\", \n \"_rev\" : \"326457675\", \n \"_key\" : \"326457675\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327178571\", \n \"_rev\" : \"327178571\", \n \"_key\" : \"327178571\", \n \"_from\" : \"persons/325998923\", \n \"_to\" : \"persons/326261067\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326261067\", \n \"_rev\" : \"326261067\", \n \"_key\" : \"326261067\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327375179\", \n \"_rev\" : \"327375179\", \n \"_key\" : \"327375179\", \n \"_from\" : \"persons/325998923\", \n \"_to\" : \"persons/326457675\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326457675\", \n \"_rev\" : \"326457675\", \n \"_key\" : \"326457675\", \n \"name\" : \"Dave\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/327178571\", \n \"_rev\" : \"327178571\", \n \"_key\" : \"327178571\", \n \"_from\" : \"persons/325998923\", \n \"_to\" : \"persons/326261067\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/326261067\", \n \"_rev\" : \"326261067\", \n \"_key\" : \"326261067\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/327571787\", \n \"_rev\" : \"327571787\", \n \"_key\" : \"327571787\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325736779\" \n }, \n { \n \"_id\" : \"knows/327768395\", \n \"_rev\" : \"327768395\", \n \"_key\" : \"327768395\", \n \"_from\" : \"persons/326654283\", \n \"_to\" : \"persons/325998923\" \n }, \n { \n \"_id\" : \"knows/326916427\", \n \"_rev\" : \"326916427\", \n \"_key\" : \"326916427\", \n \"_from\" : \"persons/325736779\", \n \"_to\" : \"persons/325998923\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/326654283\", \n \"_rev\" : \"326654283\", \n \"_key\" : \"326654283\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/325998923\", \n \"_rev\" : \"325998923\", \n \"_key\" : \"325998923\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/325736779\", \n \"_rev\" : \"325736779\", \n \"_key\" : \"325736779\", \n \"name\" : \"Alice\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Edges should only be included once globally, but nodes are included every time they are visited: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/331962699\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"uniqueness\":{\"vertices\":\"none\",\"edges\":\"global\"}}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"visited\" : { \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/332224843\", \n \"_rev\" : \"332224843\", \n \"_key\" : \"332224843\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332486987\", \n \"_rev\" : \"332486987\", \n \"_key\" : \"332486987\", \n \"name\" : \"Charlie\" \n }, \n { \n \"_id\" : \"persons/332683595\", \n \"_rev\" : \"332683595\", \n \"_key\" : \"332683595\", \n \"name\" : \"Dave\" \n } \n ], \n \"paths\" : [ \n { \n \"edges\" : [ ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/333797707\", \n \"_rev\" : \"333797707\", \n \"_key\" : \"333797707\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/331962699\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/333797707\", \n \"_rev\" : \"333797707\", \n \"_key\" : \"333797707\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/331962699\" \n }, \n { \n \"_id\" : \"knows/333994315\", \n \"_rev\" : \"333994315\", \n \"_key\" : \"333994315\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/332224843\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/332224843\", \n \"_rev\" : \"332224843\", \n \"_key\" : \"332224843\", \n \"name\" : \"Bob\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/333797707\", \n \"_rev\" : \"333797707\", \n \"_key\" : \"333797707\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/331962699\" \n }, \n { \n \"_id\" : \"knows/333994315\", \n \"_rev\" : \"333994315\", \n \"_key\" : \"333994315\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/332224843\" \n }, \n { \n \"_id\" : \"knows/333142347\", \n \"_rev\" : \"333142347\", \n \"_key\" : \"333142347\", \n \"_from\" : \"persons/331962699\", \n \"_to\" : \"persons/332224843\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/332224843\", \n \"_rev\" : \"332224843\", \n \"_key\" : \"332224843\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/333797707\", \n \"_rev\" : \"333797707\", \n \"_key\" : \"333797707\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/331962699\" \n }, \n { \n \"_id\" : \"knows/333994315\", \n \"_rev\" : \"333994315\", \n \"_key\" : \"333994315\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/332224843\" \n }, \n { \n \"_id\" : \"knows/333404491\", \n \"_rev\" : \"333404491\", \n \"_key\" : \"333404491\", \n \"_from\" : \"persons/332224843\", \n \"_to\" : \"persons/332486987\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/332224843\", \n \"_rev\" : \"332224843\", \n \"_key\" : \"332224843\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/332486987\", \n \"_rev\" : \"332486987\", \n \"_key\" : \"332486987\", \n \"name\" : \"Charlie\" \n } \n ] \n }, \n { \n \"edges\" : [ \n { \n \"_id\" : \"knows/333797707\", \n \"_rev\" : \"333797707\", \n \"_key\" : \"333797707\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/331962699\" \n }, \n { \n \"_id\" : \"knows/333994315\", \n \"_rev\" : \"333994315\", \n \"_key\" : \"333994315\", \n \"_from\" : \"persons/332880203\", \n \"_to\" : \"persons/332224843\" \n }, \n { \n \"_id\" : \"knows/333601099\", \n \"_rev\" : \"333601099\", \n \"_key\" : \"333601099\", \n \"_from\" : \"persons/332224843\", \n \"_to\" : \"persons/332683595\" \n } \n ], \n \"vertices\" : [ \n { \n \"_id\" : \"persons/331962699\", \n \"_rev\" : \"331962699\", \n \"_key\" : \"331962699\", \n \"name\" : \"Alice\" \n }, \n { \n \"_id\" : \"persons/332880203\", \n \"_rev\" : \"332880203\", \n \"_key\" : \"332880203\", \n \"name\" : \"Eve\" \n }, \n { \n \"_id\" : \"persons/332224843\", \n \"_rev\" : \"332224843\", \n \"_key\" : \"332224843\", \n \"name\" : \"Bob\" \n }, \n { \n \"_id\" : \"persons/332683595\", \n \"_rev\" : \"332683595\", \n \"_key\" : \"332683595\", \n \"name\" : \"Dave\" \n } \n ] \n } \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>If the underlying graph is cyclic, <em>maxIterations</em> should be set: The underlying graph has two vertices <em>Alice</em> and <em>Bob</em>. With the directed edges: - <em>Alice</em> knows <em>Bob</em> _ <em>Bob</em> knows <em>Alice</em> <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/traversal\n{\"startVertex\":\"persons/337205579\",\"edgeCollection\":\"knows\",\"direction\":\"any\",\"uniqueness\":{\"vertices\":\"none\",\"edges\":\"none\"},\"maxIterations\":5}\n\nHTTP/1.1 500 Internal Error\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 500, \n \"errorNum\" : 1909, \n \"errorMessage\" : \"too many iterations\" \n}\n\n</code></pre><br>",
"nickname": "executesATraversal"
}
],
"path": "/_api/traversal"
}
]
}