Neo4j 标识符可以以整数开头吗? [英] Can a Neo4j identifier start with an integer?

查看:60
本文介绍了Neo4j 标识符可以以整数开头吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MATCH (p:Product {id:'19134046594'})-[r]-> (o:Attributes {4g:'network'}) return o

我收到此异常:

Exception in thread "main" java.lang.RuntimeException: org.neo4j.driver.v1.exceptions.ClientException: Invalid input ':': expected an identifier character, whitespace or '}' (line 1, column 66 (offset: 65))

它在抱怨4g".4g"是neo4j 中无效的属性键标识符吗?如何解决这个问题?

It's complaining about '4g'. Is '4g' an invalid property key identifier in neo4j? How to work around the issue?

推荐答案

您可以使用反引号 (`) 字符引用以其他非法字符开头的属性名称.

You can use the backtick (`) character to quote property names that start with an otherwise illegal character.

例如,这会起作用:

CREATE (o:Attributes {`4g`: 'network'})
RETURN o;

这也有效:

MATCH (o:Attributes) WHERE o.`4g` = 'network'
RETURN o;

这篇关于Neo4j 标识符可以以整数开头吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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