Reputation: 49
I could use the below query for "In Degree" successfully:
match a=(p:Person)-->(q:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'})
RETURN count(a) as In_Degree
I could use the below query for "Out Degree" successfully:
match a=(p:Person)<--(q:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'})
RETURN count(a) as Out_Degree
But when I club both and write the query as below, then Cypher is giving the result of "Out Degree".
match a=(p:Person)-->(q:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'}),b=(r:Person)<--(s:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'})
RETURN count(a) as In_Degree, count(b) as Out_Degree
Am I missing something here? Could someone help me with this please?
Upvotes: 2
Views: 784
Reputation: 7478
Can you try this query :
MATCH (p:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'})
RETURN size((p)<--(:Person)) AS In_Degree, size((p)-->(:Person)) AS Out_Degree
Cheers.
Upvotes: 3