Running multiple databases

I'm trying to run multiple databases at the same time and query data to and from them.
I successfully created these databases using the following query:

CREATE DATABASE databasename1;
CREATE DATABASE databasename2;

But I am now uncertain about how I should add data to each of these individual databases. For example, if I'd run something like:

CREATE (u:User {name: "John"});

in which database context will this be executed? How to change this context?

Thanks!

Is this in Neo4j Browser, or via a driver. If browser, you need to select the database that your commands will executed against.

try the following to switch between each:
:use databasename1
:use databasename2

1 Like

I'm trying to achieve this in the nodejs driver.

Then, I believe you can specify which database when getting a session. You can pass a map of configuration key/value pairs to the session method.