apoc.convert.toSet

此函数已弃用。请改用 Cypher 的 coll.distinct() 函数。

详细信息

语法

apoc.convert.toSet(list)

描述

将给定的值转换为在 Cypher 中表示为 LIST<ANY> 的集合(set)。

参数

名称

类型

描述

list

ANY

要转换为集合的列表。

返回

LIST<ANY>

用法示例

以下示例展示了如何同时使用 APOC 和 Cypher 将列表转换为集合。

apoc.convert.toSet
RETURN apoc.convert.toSet([1,2,3,2]) AS output;
使用 Cypher 的 coll.distinct
RETURN coll.distinct([1,2,3,2]) AS output;
结果
输出

[1, 2, 3]