Owen Pauling
Owen Pauling

Reputation: 11841

Neo4j cypher query on ID returns no values via REST but does via Data Browser

Neo4j version 1.8.M06

The following query executed in the Data Browser on the web management interface returns a value for the Forename property:

start n=node(*) where ID(n)=147 return n.Forename

However the same query posted using the REST API

{
  "query" :
  "start n=node(*) where ID(n)={id} return n.Forename",
  "params" : 
  {"id" : "147"}
}

Returns:

{
  "columns" : [ "n.Forename" ],
  "data" : [ ]
}

Any idea what I'm doing wrong?

Upvotes: 3

Views: 475

Answers (1)

Eve Freeman
Eve Freeman

Reputation: 33155

You don't want quotes around 147 in the REST call.

Also, maybe it's because of your simplification, but I'm pretty sure you should really be doing start n=node({id}) instead, for optimum performance. Not sure if it optimizes that sort of thing out.

Upvotes: 1

Related Questions