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)-[:FRIENDS_WITH]-(friend;User)
WHERE user.name = "Bart Baesens"
RETURN user, count(friend) AS NumberOfFriends;
1 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 FRIENDS_WITH relation exists
Get the node for Bart Baesens and a count of all his friends, but only if at least one FRIENDS_WITH relation exists
This query will fail if Bart Baesens is FRIENDS_WITH himself

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!