I am working with the graph database Neo4j. I want to combine the following two cypher queries into one.
START a=node(2)
MATCH (a)<-[:TYPE]-(vendrs)<-[:FROM]-(prods)
RETURN vendrs.name, count(prods)
START a=node(2)
MATCH (a)<-[:TYPE]-(vendrs)<-[:FROM]-(prods)
WHERE(prods.r?<>-1 and prods.f?<=0 and prods.I! = 1)
RETURN vendrs.name, count(prods)
Node with id 2 is a super node having nodes representing vendors related to it via TYPE relationships and from each of these nodes prods are related by FROM relationship.
I want to combine them into one so i tried:
START a=node(2)
MATCH (a)<-[:TYPE]-(vendrs)<-[:FROM]-(prods)
RETURN vendrs.name,
count(prods),
filter(count(prods) where(prods.r?<>-1 and prods.f?<=0 and prods.I! = 1));
But its not working? How should i correct it?
Error:SyntaxException: Unclosed parenthesis
start a=node(2) match (a)<-[:TYPE]-(vendrs)<-[:FROM]-(prods) where prods.r?<>-1 and prods.f?<=0 and prods.I! = 1 return vendrs.name,count(prods)? - remigio