|| apoc.coll.combinations - APOC 核心文档 - Neo4j 文档

apoc.coll.combinations

详情

语法

apoc.coll.combinations(coll, minSelect [, maxSelect ])

描述

返回 `LIST<ANY>` 元素的所有组合的集合,组合大小介于 `minSelect` 和 `maxSelect` 之间(默认:`minSelect`)。

参数

名称

类型

描述

coll

LIST<ANY>

从中返回组合的列表。

minSelect

INTEGER

组合的最小选择大小。

maxSelect

INTEGER

组合的最大选择大小。默认值为:`-1`。

返回

LIST<ANY>

使用示例

以下返回 `LIST<ANY>` 元素的所有组合的集合,组合大小介于 `3` 和 `4` 个元素之间

RETURN apoc.coll.combinations([1,3,5,7,9], 3, 4) AS output;
结果
输出

[[1, 3, 5], [1, 3, 7], [1, 5, 7], [3, 5, 7], [1, 3, 9], [1, 5, 9], [3, 5, 9], [1, 7, 9], [3, 7, 9], [5, 7, 9], [1, 3, 5, 7], [1, 3, 5, 9], [1, 3, 7, 9], [1, 5, 7, 9], [3, 5, 7, 9]]

© . This site is unofficial and not affiliated with Neo4j, Inc.