I want to get all vertices from graph,as shown below
a -> b -> c -> d -> e -> f -> ...
b2 -> c2 -> cd -> ....
I want to get all vertices, and use syntax like:
[WITH vertexCollection1[, vertexCollection2[, ...vertexCollectionN]]]
FOR vertex[, edge[, path]]
IN [min[..max]]
OUTBOUND|INBOUND|ANY startVertex
GRAPH graphName
[PRUNE pruneCondition]
[OPTIONS options]
as you can see, I have to define the value of max first( IN [min[..max]]
), how can I get all vertices without providing a value for max when the depth is unknown?
This isn't possible, a max
value must either be provided, or it will default to the min
value (which in turn defaults to 1).
There's nothing to stop you from setting this to an arbitrarily large number though (eg FOR v IN 1..99999999
) - you'll get all vertices as long as max
exceeds your max depth.
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.