cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How do I let my server know which database it should access for a particular query when multiple databases are active

Hi I'm using python and neo4j for my backend development.
The new version of neo4j help us to have multiple active databases at a time that's great!
But i have ran into a problem i can't seem to understand how do i code my server such away that it understand which database it should access for that particular query

5 REPLIES 5

Hi Stephen,

welcome to the community!

I ran into similar problems some weeks ago and I think the solution is the following:

If you have the possibility to go to the Neo4j Browser in between sending queries from python, you can simply change the database against which you want to do the query by the "use" command:

:use targetDatabase

If you do not have the possibility (I do not have it, either) but want to switch databases from your code, I guess the answer for now is that it is not possible since the 4.0 Python drivers are not out yet.

In this forum entry (Cannot create multiple databases through python client(Neo4j 4.0)) it is announced that the driver is expected to be released in Q2.

Regards,
Elena

Hi Elena,

Thank you for the warm welcome!
It feels good to know there's someone out there to help you.

Correct me if I'm wrong I think the "use" command is to be used in the neo4j browser to switch between database we want to work with.

By the reply you gave me I think I show wait for the driver to be release to solve my problem.

Thank you for your reply.

Regards,
Stephen

Hi Stephen,

yes, the "use" command is to be used in the Neo4j Browser only. That is also what I meant to say in my comment:

If you have the possibility to go to the Neo4j Browser ...

Yes, I guess there is no other way for now from Python as to wait for the new driver.

Regards,
Elena

Hi again,

look what I just found: Neo4j Driver for Python Release

So apparently, there are alpha versions of the new driver available now.

Regards,
Elena

Hey Elena,

Thank you!
I'll try to get my work done by this alpha version.

Regards,
Stephen