Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 824 Bytes

neo4j.md

File metadata and controls

39 lines (29 loc) · 824 Bytes

Neo4j

REST API

Query Neo4j REST API via curl POST request

curl -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d "@query.json" http://localhost:7474/db/data/transaction/commit

query.json

{ "statements": [{ "statement": "MATCH (n) RETURN n LIMIT 10" }] }

First, add to neo4j.conf

apoc.export.file.enabled=true

Exports nodes and relationships from the cypher statement including indexes as cypher statements to the provided file

CALL apoc.export.cypher.query(
  "MATCH (p1:Person)-[r:KNOWS]->(p:Person) RETURN *",
  "export.cypher",
  {}
);

Importing Subgraphs

neo4j-shell -file export.cypher -path /path/to/graph.db