Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-30-2020 11:01 PM
hii Everyone,
we have created a graph and there are three database running in it ,and if i am trying to connect it with python using py2neo then it connecting to default database, so if we want to select 1 out of 3 database ,is there anyway using py2neo and any python to neo4j connector(neo4j driver).
Solved! Go to Solution.
05-01-2020 12:28 AM
Hi there,
Make sure you use the v5 version of py2neo; multi database support as found in Neo4J 4 is not supported in v4 of py2neo. In v5 it is supported via the name= parameter in the Graph object.
https://py2neo.org/v5/database.html#the-graph
class py2neo.database.Graph(uri, name=None, **settings)[source]
The Graph class represents the graph data storage space within a Neo4j graph database. Connection details are provided using URIs and/or individual settings.
The name argument allows selection of a graph database by name. When working with Neo4j 4.0 and above, this can be any name defined in the system catalogue, a full list of which can be obtained through the Cypher SHOW DATABASES command. Passing None here will select the default database, as defined on the server. For earlier versions of Neo4j, the name must be set to None.
05-01-2020 12:28 AM
Hi there,
Make sure you use the v5 version of py2neo; multi database support as found in Neo4J 4 is not supported in v4 of py2neo. In v5 it is supported via the name= parameter in the Graph object.
https://py2neo.org/v5/database.html#the-graph
class py2neo.database.Graph(uri, name=None, **settings)[source]
The Graph class represents the graph data storage space within a Neo4j graph database. Connection details are provided using URIs and/or individual settings.
The name argument allows selection of a graph database by name. When working with Neo4j 4.0 and above, this can be any name defined in the system catalogue, a full list of which can be obtained through the Cypher SHOW DATABASES command. Passing None here will select the default database, as defined on the server. For earlier versions of Neo4j, the name must be set to None.
05-30-2020 07:55 AM
Hi Paul,
I followed what you said and tried it out when I set name=None it my data gets added to the default(neo4j$) database but when I try using the database what i created i cannot get my data entered in that database the program runs fine without any error but my data does not get added.
05-03-2020 11:12 AM
Thanks @webtic , it worked fine.
is there any time lag in executing the query every time we call it in python?
05-13-2020 03:01 PM
There is always some overhead of course but in my daily usage I never had the urge to bypass the Python driver in favour of a more native one.
All the sessions of the conference are now available online