Can I send neo4j browser a cypher query via get/po

2019-05-08 03:33发布

How can I send (programatically) a cypher query to neo4j browser (via get/post) in order to display the resulted graph? e.g., something like: http://localhost:7474/browser/query='match n return n'

1条回答
贪生不怕死
2楼-- · 2019-05-08 03:57

Yes, you can.

Example request

POST http://localhost:7474/db/data/cypher
Accept: application/json; charset=UTF-8
Content-Type: application/json
{
  "query" : "MATCH (x {name: 'I'})-[r]->(n) RETURN type(r), n.name, n.age",
  "params" : {
  }
}

Example response

200: OK
Content-Type: application/json; charset=UTF-8
{
  "columns" : [ "type(r)", "n.name", "n.age" ],
  "data" : [ [ "know", "him", 25 ], [ "know", "you", null ] ]
}
查看更多
登录 后发表回答