# Running multiple databases

**URL:** <https://community.neo4j.com/t/running-multiple-databases/52834>\
**Category:** Neo4j Graph Platform\
**Created:** [March 3, 2022, 1:41pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834 "2022-03-03T13:41:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bramvbilsen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bramvbilsen/32/21225_2.png) [@bramvbilsen](https://community.neo4j.com/u/bramvbilsen)\
**Post date:** [March 3, 2022, 1:41pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834/1 "2022-03-03T13:41:01Z")

</div>

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:

```auto
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:

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

```

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

Thanks!

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [March 3, 2022, 3:20pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834/2 "2022-03-03T15:20:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bramvbilsen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bramvbilsen/32/21225_2.png) [@bramvbilsen](https://community.neo4j.com/u/bramvbilsen)\
**Post date:** [March 3, 2022, 11:11pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834/3 "2022-03-03T23:11:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [March 3, 2022, 11:18pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834/4 "2022-03-03T23:18:35Z")

</div>

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.

> **[Driver | Neo4j Bolt Driver 5.x for JavaScript](https://neo4j.com/docs/api/javascript-driver/current/class/lib6/driver.js~Driver.html)**
>
> The official Neo4j driver for Javascript

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [March 3, 2022, 11:29pm UTC](https://community.neo4j.com/t/running-multiple-databases/52834/5 "2022-03-03T23:29:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/e/4/e444f82e647135a0f0cf165921a790055307b921.jpeg)
