Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to query for the active database name in Cypher/Neo4J?

We have a multi-db setup on a stand-alone server. We can change the db which we query by :use ... where … is the database to which queries are directed.

I would like to know if there is a query we can run to check which database we are currently running queries to, something like
SHOW ACTIVE DATABASE or something like that.

Tried ACTIVE, CURRENT but neither seems to work. Tried checking for a field in SHOW DATABASES which may indicate the database I am currently querying towards. Nothing there either…

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This should be possible but I couldn’t find any documentation to it.

>Solution :

You can use the following query :

CALL db.info()
YIELD name
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading