【发布时间】:2019-01-18 02:02:53
【问题描述】:
我正在通过 php 发送密码查询。
match (n:person)-[:watched]->(m:movie)
where m.Title in $mycollection
return count(distinct n.id);
这将返回观看过我收藏中电影的人数。 我实际上想返回名称列表,并且返回 n.name 工作正常。
当我尝试同时返回 n.name 和 count(distinct n.id) 时,我会丢失总计数并获得每行的计数。
match (n:person)-[:watched]->(m:movie)
where m.Title in $mycollection
return n.name, count(distinct n.id);
不起作用。每行的计数列显示为 1。
由于我使用的是php,我也尝试过:
$count = $result->getNodesCount();
无济于事。所以我使用php来计算数组。但是感觉 Cypher 应该可以做到吧?
【问题讨论】: