neo4j: How do I change the database storage location?

You first need confirm that the database you are connecting to was properly shut down (means you should not take the image of a running database). Set the location of the database if you are in server mode from the file conf/neo4j-server.properties by editing the below line. org.neo4j.server.database.location=data/graph.db if you are using embedded neo4j you … Read more

Adding relationship to existing nodes with Cypher

In Neo4j 2.0 you can create schema indexes for your labels and the properties you use for lookup: CREATE INDEX ON :User(username) CREATE INDEX ON :Role(name) To create relationships you might use: MATCH (u:User {username:’admin’}), (r:Role {name:’ROLE_WEB_USER’}) CREATE (u)-[:HAS_ROLE]->(r) The MATCH will use an index if possible. If there is no index, it will lookup … Read more