计数集合时计数不正确

问题描述 投票:0回答:1

这是我的查询

match ( user{displayName:'Mahmoud'})-[:LIKES]->(artists:ARTIST)-[:PLAYS]->(genres) with 
user,collect(distinct genres) as user_genres
match(users)-[:LIKES]-(artists:ARTIST)-[:PLAYS]->(common_genres) where common_genres in user_genres
with user,users,collect( distinct common_genres) as coll_common_genres
return user,users,coll_common_genres, count(coll_common_genres)

[当计算结果coll_common_genres为6个条目的集合时,common_genres_count给我1,有时给我4是什么问题image of output

database neo4j
1个回答
0
投票

所以我不得不使用SIZE,因为它是一个列表,但是如果有人可以解释,我不知道为什么它是一个列表

© www.soinside.com 2019 - 2024. All rights reserved.