如何 remove/delete 从 RedisGraph 复制节点

How to remove/delete duplicate nodes from RedisGraph

谁能帮我从 RedisGraph 中删除特定标签的重复节点。我在 Neo4j 中发现了密码查询,但在 Redis 中不支持。请帮我解决这个问题。

我使用下面的查询,然后 RedisInsight 抛出错误

MATCH (p:Person)
WITH p.id as id , collect(p) AS nodes 
WHERE size(nodes) >  1
RETURN [ n in nodes | n.id ] AS ids, size(nodes)
ORDER BY size(nodes) DESC

错误:RedisGraph 目前不支持列表理解

要删除重复项,您可以使用以下方法

MATCH (p:Person)
WITH p.id as id, collect(p) AS nodes 
WHERE size(nodes) >  1
UNWIND nodes[1..] AS node
DELETE node