How to delete/create databases in Neo4j?

前端 未结 12 1213
既然无缘
既然无缘 2020-12-12 11:52

Is it possible to create/delete different databases in the graph database Neo4j like in MySQL? Or, at least, how to delete all nodes and relationships of an existing graph t

12条回答
  •  青春惊慌失措
    2020-12-12 12:41

    Run your test code on a different neo4j instance.

    1. Copy your neo4j directory into a new location. Use this for testing. cd into the new directory.
    2. Change the port so that you can run your tests and use it normally simultaneously. To change the port open conf/neo4j-server.properties and set org.neo4j.server.webserver.port to an unused one.
    3. Start the test server on setup. Do ./neo4j stop and rm -rf data/graph.db on teardown.

    For more details see neo4j: How to Switch Database? and the docs.

提交回复
热议问题