0
我可以把條件放在count()中嗎?讓我解釋。計數功能中的條件
START me=node:node_auto_index(UserProfileID = '1'), other=node(*)
MATCH pMutualFriends=me-[r?:friends]-mf-[r1:friends]-other
WHERE other.UserName? =~ '(?i)dh.*' AND other.UserProfileID? <> 1
RETURN me.EMailID, other.EMailID,other.UserProfileID, other.UserName, r.ApprovalStatus, COUNT(pMutualFriends) AS mutualCount
在上面的查詢中我可以像這樣用戶。
COUNT(pMutualFriends where r.ApprovalStatus = 1 AND r1.ApprovalStatus =1)
或者可能以其他方式?
謝謝
感謝@斯蒂芬 - ARMBRUSTER,應關係的性質這項工作?我已經在這裏上傳了示例數據:http://stackoverflow.com/questions/17947903/search-list-with-mutual-count-2nd-try?noredirect=1#comment26542030_17947903 –
是的,過濾器處理關係屬性,請參閱更新以上。 –
您好@ stefan-armbruster,我已檢查您的查詢。它工作正常,但沒有返回我的預期結果。我還想讓node6(名稱:dhansukh)的相互計數爲0或爲空。請在預期結果看看http://stackoverflow.com/questions/17947903/search-list-with-mutual-count-2nd-try?noredirect=1#comment26542030_17947903 –