Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-18-2020 12:33 PM
Hi All,
Someone already tried to get one Path based on some attribute ? I'm trying this one:
MATCH (r1:EndNode { Name:'aaa'}),(r2:EndNode { Name:'bbb'})
MATCH p = allShortestPaths((r1)-[r*]-(r2)) WHERE r.Denied <> 'TESTONE' return p
Without WHERE cause works. but when I try to filter doesn't works.
12-18-2020 03:11 PM
Neo4j 4.2.1
This is the data.
CREATE (r1:EndNode {Name: 'aaa'})-[:REL {Denied: 'HOGEHOGE'}]->(r2:EndNode {Name: 'bbb'}),
(r1)-[:REL {Denied: 'TESTONE'}]->(:EndNode {Name: 'ccc'})-[:REL {Denied: 'TESTONE'}]->(r2),
(r1)-[:REL {Denied: 'TESTONE'}]->(:EndNode {Name: 'ddd'})-[:REL {Denied: 'TESTONE'}]->(r2);
MATCH (r1:EndNode {Name: 'aaa'}), (r2:EndNode {Name: 'bbb'})
MATCH p = allShortestPaths((r1)-[r*]-(r2))
WHERE ALL(r IN relationships(p) WHERE r.Denied = 'TESTONE')
RETURN p;
12-21-2020 09:07 AM
I think this one doesn't works on 3.4 version, b/c I saw all links (even with Denied set to HOGEHOGE) in result....Any other idea?
12-21-2020 01:55 PM
I think that the problem is related with Neo4j web browser interface and not server. I made the same query using python (py2neo) and saw the correct topology (avoiding HOGEHOGE edges).. So your query works perfectly. So many thanks Sr.
All the sessions of the conference are now available online