apoc.coll.indexOf函数25 版本已弃用
|
此函数已弃用。请改用 Cypher 的 |
语法 |
|
||
描述 |
返回指定值在 |
||
参数 |
名称 |
类型 |
描述 |
|
|
要在其中查找给定值的列表。 |
|
|
|
要在给定列表中查找其首次出现位置的值。 |
|
返回 |
|
||
使用示例
以下示例同时使用 APOC 和 Cypher 返回列表中值 3 的索引
apoc.coll.indexOf
RETURN apoc.coll.indexOf([1,3,5,7,9], 3) AS output;
使用 Cypher 的 coll.indexOf
RETURN coll.indexOf([1,3,5,7,9], 3) AS output;
| 输出 |
|---|
1 |
以下示例返回 -1,因为在使用 APOC 和 Cypher 时均未能在列表中找到该值
apoc.coll.indexOf
RETURN apoc.coll.indexOf([1,3,5,7,9], 4) AS output;
使用 Cypher 的 coll.indexOf
RETURN coll.indexOf([1,3,5,7,9], 4) AS output;
| 输出 |
|---|
3 |