MATCH (u1:User)-[:Couple]-(u2:User)
WHERE u1.birthday[5..7] = u2.birthday[5..7] AND
((u1.zodiac = '鼠' AND u2.zodiac = '牛') OR
(u1.zodiac = '牛' AND u2.zodiac = '鼠') OR
(u1.zodiac = '虎' AND u2.zodiac = '猪') OR
(u1.zodiac = '猪' AND u2.zodiac = '虎') OR
(u1.zodiac = '兔' AND u2.zodiac = '狗') OR
(u1.zodiac = '狗' AND u2.zodiac = '兔') OR
(u1.zodiac = '龙' AND u2.zodiac = '鸡') OR
(u1.zodiac = '鸡' AND u2.zodiac = '龙') OR
(u1.zodiac = '蛇' AND u2.zodiac = '猴') OR
(u1.zodiac = '猴' AND u2.zodiac = '蛇') OR
(u1.zodiac = '马' AND u2.zodiac = '羊') OR
(u1.zodiac = '羊' AND u2.zodiac = '马'))
RETURN u1, u2
MATCH (target:User {id: targetUserId})-[:FriendOf*3]-(friend:User)
WHERE NOT (target)-[:FriendOf]-(friend)
WITH friend, target.birthday AS targetBirthday, friend.birthday AS friendBirthday,
abs(dateDiff(targetBirthday, friendBirthday)) AS birthdayDiff
RETURN friend
ORDER BY birthdayDiff ASC
LIMIT 1
MATCH (u:User { id: '<某个用户的 ID>' })-[:FriendOf*3]-(friend:User)
WHERE NOT (u)-[:FriendOf]-(friend) AND friend.id <> u.id
WITH friend, u, ABS(DATE_DIFF(u.birthday, friend.birthday)) AS birthday_diff
ORDER BY birthday_diff ASC
LIMIT 1
RETURN friend
FETCH PROP ON Couple WHERE
(src.birthday.month = dst.birthday.month) AND
((src.zodiac = '鼠' AND dst.zodiac = '牛') OR (src.zodiac = '牛' AND dst.zodiac = '鼠'))
YIELD src._id AS user1, dst._id AS user2;
use sf0_1
match (v1:Person)-[e:Couple]->(v2:Person where a.birthday=b.birthday and a.zodiac=b.zodiac and b.zodiac in ["鼠","牛"])
return v1.id,v1.birthday,v1.zodiac,v2.id,v2.birthday,v2.zodiac