Neo4j:Cypher –属性值只能是原始类型或其数组
生活随笔
收集整理的這篇文章主要介紹了
Neo4j:Cypher –属性值只能是原始类型或其数组
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
本周初,當(dāng)我嘗試在我認(rèn)為要共享的節(jié)點(diǎn)上創(chuàng)建數(shù)組屬性時(shí),遇到了一個(gè)有趣的Cypher錯(cuò)誤消息。
這是我寫的Cypher查詢:
CREATE (:Person {id: [1, "mark", 2.0]})導(dǎo)致此錯(cuò)誤:
Neo.ClientError.Statement.TypeError Property values can only be of primitive types or arrays thereof.實(shí)際上,我們存儲(chǔ)著一組原始元素,但是我們混合了不同類型的元素,這是不允許的。 讓我們嘗試將所有值強(qiáng)制轉(zhuǎn)換為字符串:
CREATE (:Person {id: [value in [1, "mark", 2.0] | toString(value)]})Added 1 label, created 1 node, set 1 property, completed after 4 ms.成功!
翻譯自: https://www.javacodegeeks.com/2017/12/neo4j-cypher-property-values-can-primitive-types-arrays-thereof.html
總結(jié)
以上是生活随笔為你收集整理的Neo4j:Cypher –属性值只能是原始类型或其数组的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Epic 喜加一:《911 接线员》免费
- 下一篇: 华为在海外推出 Eyewear 2 智能