Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-04-2021 02:50 AM
It seems that limit is not enforced on paths. My query:
match p=(n{name:'Richard Harris'})-[*]-(m{name:'Wil Wheaton'}) return p limit 1
I'm testing on the sample Movie DBMS (v. 4.3.3) in Neo4j Desktop. How should I enforce the limit on the number of paths?
I also tried this one but still I see many nodes and relationships:
match p=(n{name:'Richard Harris'})-[*]-(m{name:'Wil Wheaton'})
With p
limit 1
return p
11-04-2021 07:52 AM
Hi @shayantest2 !
It works. it's just that this path you are getting is too long so you thinks is more than one. Remember that you are using the wildcard *
Bennu
11-05-2021 04:02 PM
If you're talking about the graphical results view from the Neo4j Browser, then this is because the browser will issue a separate query under the hood to get all the relationships existing between the nodes that were retrieved from your query, so you'll see more relationships than occur in the original query's results. All of the nodes involved however should be along the single path returned from your original query with LIMIT 1.
You can toggle off the 'Connect result nodes' checkbox from the browser preferences.
All the sessions of the conference are now available online