简体   繁体   中英

GRAPH_TRAVERSAL result enclosed in (Array of) Array of Array in Arangodb

I am exploring Arangodb and in particular Graph Operations

I am referring to example in the section 12.9 Graph Operations of the doc.

The result of GRAPH_TRAVERSAL_TREE query operations are inserted in Array of Array of Array:

[[[{"_id":", "connection": []  }]]]

Is there a reason for this ?

The reason is the internal format and backwards compatibility:

To describe it in a bit more detail:

The outer most array is added by AQL which always encapsulates it's result in an array, within the AQL query this outer array is not there. The second array is added because GRAPH_TRAVERSAL_TREE uses an example for the start-vertex. This example could match more than one vertex (eg: {name: 'Peter'} would be a valid value for startVertex). Each of these startVertices will have one entry in this array. The innermost array is for compatibility reasons with TRAVERSAL_TREE. Hence we get 3 layers of arrays in this function.

But please stay tuned for one of next releases. We are working hard on a new interface for graph traversals making it much easier to control the traversal and the result format. (This does not mean we will abandon the Graph features we already have ;) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM