简体   繁体   中英

How to query for properties with dashes in Neo4j using Cypher

I am trying to query for properties in Neo4j using the Cypher Query API. The query I am attempting is as follows:

String query = "start n=node(*) where (n.property-id = 'someid') return ID(n)"

I get an error when executing as follows: Exception in thread "main" Unknown identifier id .

So, this means that Neo4j is treating the dash in property-id as a keyword. How does one go about formulating queries with dashes in a node/relationship property?

Thank you.

用反引号逃离该物业:

String query = "start n=node(*) where (n.`property-id` = 'someid') return ID(n)"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM