Question: What does the following Cypher query express? OPTIONAL MATCH ( user;User ) - [ :FRIENDS _ WITH ] - ( friend;User ) WHERE user.name =
What does the following Cypher query express?
OPTIONAL MATCH user;User:FRIENDSWITHfriend;User
WHERE user.name "Bart Baesens"
RETURN user, countfriend AS NumberOfFriends;
point
Get the node for Bart Baesens and all his friends
Get the node for Bart Baesens and a count of all his friends, even if no FRIENDSWITH relation exists
Get the node for Bart Baesens and a count of all his friends, but only if at least one FRIENDSWITH relation exists
This query will fail if Bart Baesens is FRIENDSWITH himself
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
