0

Calling

new GraphDatabaseFactory().newEmbeddedDatabase(File storeDir);

in the Neo4j Java API not only opens a database at a given location but also creates one if it doesn't already exist.

I would like to check if a Neo4j database exists in a given directory without creating one if it doesn't. How can I accomplish that?

DeLoreanDriver
  • 205
  • 1
  • 10

1 Answers1

0

I now do this by checking if there is a neostore file in the store directory and by trying to get it's version.

See how you can get the store version here: Determine Neo4j database version

DeLoreanDriver
  • 205
  • 1
  • 10