Hey!
I am trying a model similar to a real Blockchain. I am trying to query what transactions and addresses may be related to a particular person, and for that, I was trying to do a recursive query. But due to the large nature of something like this, I wanted to limit the number of visited Transaction nodes to an arbitrary number.
I was thinking something of like what was asked in this StackOverflow [post].(neo4j - How can I Limit nodes on each level of children in tree with cypher query - Stack Overflow)
I wanted to do something like a mix of these two queries:
MATCH (address:Address)-[:SENDS|RECEIVES]->(tx:Transaction)<-[:SENDS|RECEIVES]-(other_address:Address)
WITH address, tx, tx.timestamp AS timestamp, other_address
ORDER BY timestamp DESC LIMIT 5 // limit to 5 transactions for each address
RETURN address, tx, other_address
This one would be the filtering of the transactions, and this one the actual recursive query:
MATCH path=(a:Address)-[:SENDS|RECEIVES*1..3]-(t:Transaction)<-[:SENDS|RECEIVES]-(other:Address)
RETURN path
Is there maybe an apoc procedure that I can use? I tried using the apoc spanning tree but it cant limit the size of the extended leafs. Thanks in advance!