agensgraph icon indicating copy to clipboard operation
agensgraph copied to clipboard

feature or bug? -- infinite path has minimum length of 1

Open pebbe opened this issue 5 years ago • 0 comments

The AgensGraph Developer Manual has this example and calls it an infinite path:

(a)-[*]->(b)

I assumed, this meant a path of any length, but as it turns out, this is a path with a minimum length of 1. See:

peter=# match (:node{id:1})-[r:rel*]->(:node{id:1}) return r limit 1;
 r 
---
(0 rows)

peter=# match (:node{id:1})-[r:rel*0..]->(:node{id:1}) return r limit 1;
 r  
----
 []
(1 row)

So * means length 1 or longer, and *0.. means any length.

Is this working as intended, or is it a bug?

It should be documented in the AgensGraph Developer Manual what the exact meaning of a bare * is.

I also searched for documentation on openCypher and Neo4j, but I could find no mention of any lower bound.

pebbe avatar Nov 21 '20 16:11 pebbe