如何确定neo4j中节点内的属性值类型? [英] How to determine property value type within a node in neo4j?

查看:1303
本文介绍了如何确定neo4j中节点内的属性值类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前-似乎没有一种方法可以确定节点(或关系)中的属性值是数组/集合还是字符串.

Currently - there does not appear to be a way to determine if a property value in a node (or relationship) is an array/collection or a string.

match(n),其中isArray(n.myprop)....

match (n) where isArray(n.myprop) ....

当试图了解与更新和查询相关的数据类型时,这将非常方便.具体来说,如果您遇到的情况是尝试更新属性值,并且需要了解如何"基于当前值的存储方式来更新它们.

this would be super handy when trying to understand the types of data you are working with relative to your updates and queries. Specifically, if you had situations were you were trying to update property values and needed to know "how" to update them based on how the current values were stored.

推荐答案

现在没有内置内容,但这将是一个很好的补充.随时在github上提出问题.

Right now there is nothing built in but it would be a good addition. Feel free to raise an issue on github.

像这样的事情在那之前可能会有所帮助?

Something like this could help until then?

CREATE ({ a:1,b:"a",c: [1,2,3]})

MATCH (a)
RETURN size(a.a),
CASE a.a
WHEN toInt(a.a)
THEN 'int'
WHEN toFloat(a.a)
THEN 'float'
WHEN toString(a.a)
THEN 'string'
WHEN [x IN a.a | x]
THEN 'coll'
WHEN NULL THEN 'null'
ELSE 'unknown' END , size(a.b), size(a.c)

这篇关于如何确定neo4j中节点内的属性值类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆