I am trying to develop a product like a google drive. This is the second phase now. I am stuck in making cypher query and I need help.
a user A can share a file/folder w
[UPDATED]
This query should return the group-accessible a
directory that is closest to the root, starting at a specific (sub)directory:
MATCH p=(g:group)-[:CAN_ACCESS_DIR]->(d:directory)<-[:CONTAINS*0..]-(a)
WHERE g.name = "group1" AND d.name = "JAVA2"
MATCH (a)<-[:CAN_ACCESS_DIR]-(g)
RETURN p, a
ORDER BY LENGTH(p) DESC
LIMIT 1
Since a single MATCH
clause would filter out multiple uses of the same relationship, this query uses 2 MATCH
clauses to allow the same CAN_ACCESS_DIR
relationship to match twice, in case d
is the only accessible directory (and therefore the same as a
).