Deepak Agarwal
Deepak Agarwal

Reputation: 905

GRAPH_EDGES not working and documentation not helping

Ok so I am posting here because ArangoDB documentation is not helping me. I am moving from 2.5.7 to latest ArangoDB. I was using the GRAPH_EDGES in one of the query and it is not working anymore. I followed https://github.com/arangodb/docs/blob/28b266f143232beb17e5c35cd545d4f3909a1815/3.6/cookbook/aql-migrating-graph-functions-to3.md but this is not correct. At one place it says not to use @graphName but then it keep showing the use of it. My Query is as following:

{"query":"for P in GRAPH_EDGES(@graph, @example, {edgeCollectionRestriction:\"myEdgeCollection\"}) RETURN P","bindVars":{"example":{"signature":"sig1"}, "graph" : "GRAPH2"}}

I tried the following query change and it returns empty result:

{"query":"for P in ANY @startId myEdgeCollection  RETURN P","bindVars":{"startId":{"signature":"sig1"}}}

Can somebody help.

Upvotes: 1

Views: 42

Answers (1)

mpv89
mpv89

Reputation: 1891

The use of graphName depends on the case. The docu doesn't tell you to never use it anymore.

In your case you have to replace P with v, e. You can find more information about the syntax here.

Then your code should look like follow:

{"query":"for v, e in ANY @startId myEdgeCollection RETURN e","bindVars":{"startId":{"signature":"sig1"}}}

Upvotes: 1

Related Questions