Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-22-2021 12:47 AM
Hello,
I tried to make a request but I'm having a bit of trouble with the cypher being new.
So my request in question: Calculate the number of apples which are in basket 1 and in basket 2 (knowing that apple, basket 1 and basket 2 are 3 different objects and that there is a relation of basket 1 -> apple and basket 2 -> apple)
I tried this :
MATCH (a:Apple)<-[:INCLUDE_ON]-(bO:BasketOne)-[:INCLUDE]->(bT:BasketTwo)
WITH a, bT, count(abT) as cnt
RETURN cnt;
But it doesnt works...
Thanks for your help!
Solved! Go to Solution.
11-22-2021 05:01 AM
Hi,
I resolve my problem with some search, that was the request i want, if you want to see it ->
MATCH (b1:Basket1)-[:INCLUDE_ON]->(a:Apple)<-[:INCLUDE_ON]-(b2:Basket2) RETURN B1.id as Basket1, b2.id as Basket2, count(a) as Apple_Number;
11-22-2021 02:22 AM
Hello @Mastege and welcome to the Neo4j community
Can you run this command and give us the result here?
CALL db.schema.visualization()
Regards,
Cobra
11-22-2021 04:57 AM
you reference a count(abT)
but I do not see where we defined abT
Also But it doesnt works...
? Can you provide more specifics? You get a syntax error? you get wrong results? the query doesnt complete ?
11-22-2021 05:01 AM
Hi,
I resolve my problem with some search, that was the request i want, if you want to see it ->
MATCH (b1:Basket1)-[:INCLUDE_ON]->(a:Apple)<-[:INCLUDE_ON]-(b2:Basket2) RETURN B1.id as Basket1, b2.id as Basket2, count(a) as Apple_Number;
11-22-2021 05:01 AM
Thanks for the help !
All the sessions of the conference are now available online