Continuous query with Neo4j


(Eric) #1

I have a requirement on my system to support subscriptions to parts of a graph, based on cypher queries.
Basically, if a user wants to get all nodes related to a specific relationship, the query MATCH (n)-[r:my_relationship]->(p) RETURN p will give the wanted results. But if later a new node with this relationship is created, I would like to notify the users who subscribed with this new node. So, I need what we call a continuous query system, that is to say a way to re-execute automatically the queries which are impacted by graph modifications (create/update/delete). Of course, I can have more complex queries with LIMIT, sorting, etc.

What is the best way to support continuous queries with Neo4j ?