简体   繁体   中英

How to fetch all Vertices data from the ArangoDB Graph using REST api

GET /_api/gharial/{graph-name}/vertex/{collection-name}/{vertex-key}

The above API fetches a specific vertex.

I want to fetch all vertices from the given graph-name using the REST API of ArangoDB.

Something like: SELECT * FROM vertices .

Due to the resource intense nature of this, ArangoDB doesn't implement this directly.

You can use the export API to export complete collections. You will have to do this for all of your vertex collections belonging to your special graph.

The other possibility is to run AQL queries that return all documents:

FOR x IN vertexCollection RETURN x

for each of your collections using streaming queries, or a combined (even more resource intense) query to all of your vertex collections:

let vertexColA = (FOR x IN vertexCollectionA RETURN x)
let vertexColB = (FOR x IN vertexCollectionB RETURN x)
RETURN CONCAT(vertexColA, vertexColB)

Please note that this query will not be streameable.

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