Is it possible to connect to AuraDB with neomodel?

Viewed 232

Is it possible to connect to AuraDB with neomodel?

AuraDB connection URI is like neo4j+s://xxxx.databases.neo4j.io.
This is not contained user/password information.

However, connection config of neomodel is bolt and it is contained user/password information.
config.DATABASE_URL = 'bolt://neo4j:password@localhost:7687'

1 Answers

Connecting to neo4j Aura uses neo4j+s protocol so you need to use the provided uri by Aura.

Reference: https://neo4j.com/developer/python/#driver-configuration

In example below; you can set the database url by setting the userid and password along with the uri. It works for me so it should also work for you.

from neomodel import config

user = 'neo4j'
psw = 'awesome_password'
uri = 'awesome.databases.neo4j.io'
    
config.DATABASE_URL = 'neo4j+s://{}:{}@{}'.format(user, psw, uri)
print(config.DATABASE_URL)

Result: 

   neo4j+s://neo4j:awesome_password@awesome.databases.neo4j.io
Related