I am quite new to Neo4j and cypher queries and it would be great if you could help me.
I have the following nodes:
Transaction (tx)
Output (output)
with the following relations:
Incoming (in)
Outgoing (out)
a Transaction creates 1-n outputs which can be used as inputs for other transactions.
I want to check, which outputs and transactions are children of a target transaction (means, created inputs for the target transaction.) This query checks 2 hops back:
MATCH path= (roottx:tx {txid:'266160772'})<-[:in|:out]-(output0:output)<-[:in|:out]-(subtx:tx)<-[:in|:out]-(output1:output)<-[:in|:out]-(subtx1:tx)<-[:in|:out]-(output2:output)
RETURN path
On additional idea came to my mind, which I am trying to find a query:
It would be great to see the interactions of transactions. Means, I would like to see only transactions in my graph, without he outputs of the transactions (see picture above).
I tried to formulate the query like this:
MATCH (roottx:tx {txid:'266160772'})<-[:in|:out*1..6]-(tx:tx)
RETURN tx