0
votes

I have a Cypher Neo4J query of the following kind:

START rel=relationship:relationship_auto_index(user="9d6e7140-f3c3-11e3-927f-1f5ca4210ac7") 
RETURN rel;

Do you know know how I filter to return only the rels that have :TO label? I know I could do it otherwise, but I need to use legacy indexing and want to filter through the relationships I got. Thanks!

1

1 Answers

2
votes

Cypher has a TYPE function:

START rel=relationship:relationship_auto_index(user="9d6e7140-f3c3-11e3-927f-1f5ca4210ac7") 
WHERE TYPE(rel)='TO'
RETURN rel;

Be aware to omit the colon in front of TO as it's not part of the relationship type itself.