简体   繁体   中英

How to check if a Neo4j database existis at a given location

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM