[英]Neo4j: How to find all nodes that: connected to either 0 nodes with specific property, or all nodes with property set
[英]How to find nodes with string type property in Neo4j?
我有一個標簽Users
,其屬性為userid
。 所以我想獲取所有具有字符串類型userid
節點。 可能嗎?
喜歡:
MATCH (n:Users) where n.userid IS string RETURN n
Neo4j中沒有開箱即用的功能來檢查數據類型,但是您可以隱式檢查給定值是否為字符串,以嘗試轉換為字符串並與原始值進行比較,如下所示:
match (n:Users)
where toString(n.userid) = n.userid
RETURN n
另外,您可以通過以下方式安裝APOC Procedures並使用功能apoc.meta.type
:
match (n:Users)
where apoc.meta.type(n.userid) = "STRING"
return n
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.