|| apoc.meta.cypher.isType - APOC 核心文档 - Neo4j 文档

apoc.meta.cypher.isType

详情

语法

apoc.meta.cypher.isType(value, type)

描述

如果给定值与给定类型匹配,则返回 true。

参数

名称

类型

描述

value

任意类型

要检查其类型的对象。

type

字符串

验证类型。

返回

布尔值

使用 Cypher 检查类型

Cypher 无需使用 APOC 即可检查类型。

检查类型的 Cypher 语法
RETURN 1.0 IS :: INTEGER;

有关更多信息,请参阅 Cypher 手册 → 类型谓词表达式

使用示例

以下示例演示了如何使用 Cypher 和 APOC 测试类型

apoc.meta.cypher.isType
RETURN apoc.meta.cypher.isType(1, "NODE") AS output;
类型谓词表达式
RETURN 1 IS :: NODE AS output;
结果
输出

false

apoc.meta.cypher.isType
RETURN apoc.meta.cypher.isType(datetime(), "DATE_TIME") AS output;
类型谓词表达式
RETURN datetime() IS :: ZONED DATETIME AS output;
结果
输出

true

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