jamesfer / cypher-query-builder

An flexible and intuitive query builder for Neo4j and Cypher.
http://jamesfer.me/cypher-query-builder/index.html
MIT License
105 stars 22 forks source link

Support storing match pattern in a variable #91

Open jamesfer opened 5 years ago

jamesfer commented 5 years ago

When using MATCH, the path pattern can be stored in a variable for use in FOREACH clauses or other functions.

Possible implementation could be:

query.match('path', [
  node('person'),
  relation('out', [ 'FriendsWith' ]),
  node('friend'),
])
// MATCH path = (person)-[:FriendsWith]->(friend)