based on The Neo4j docs, executing:
:POST /db/data/transaction/commit
{"statements":[{"statement":"MATCH path = (n)-[r]->(m) RETURN path",
"resultDataContents":["graph","row"]}]}
in the neo4j browser returns the graph structure plus the rows. I wonder how can I specify ("resultDataContents":["graph","row"]) in a jQuery ajax request. I have tried this which doesn't work:
var request = $.ajax({
type: "POST",
url: "http://localhost:7474/db/data/cypher",
accepts: { json: "application/json" },
dataType: "json",
contentType:"application/json",
data: JSON.stringify({ "query" : "MATCH (n)--(m) RETURN n,m LIMIT 2", "params": {"resultDataContents":["graph","row"]} })
});
Essentially I want to build a neo4j browser clone where I can submit queries and receive the results and perhaps visualize them.