0

我正在尝试 neo4j,我cineasts_39_movies_446_actors.zip这里下载并成功配置了示例数据集

我可以很好地查询节点1:

neo4j-sh (0)$ START n=node(1) RETURN n
==> +------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | n                                                                                                                                                          |
==> +------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | Node[1]{login:"micha",roles:["ROLE_ADMIN","ROLE_USER"],name:"Micha",password:"339f455efd4af00b3e62385f3b7ef694",__type__:"org.neo4j.cineasts.domain.User"} |
==> +------------------------------------------------------------------------------------------------------------------------------------------------------------+

如何查询名称为 Micha 的节点?谢谢

4

1 回答 1

3

怎么样:

start n=node:User("login:micha") return n;

索引查找的语法如下:

<node/relationship>:<index name>(<lucene query/shorthand single field lookup>)

速记看起来像这样,并且更容易参数化:

start n=node:User(login="micha") return n;

并像这样在 JSON 中参数化:

{query:"start n=node:User(login={username}) return n;", params:{username:"micha"}}
于 2013-03-07T20:21:21.907 回答