Configuring the database

The config file

The config file for the database is located here (you need to create it initially):


Here is an example config:

    "username": "myuser",
    "password": "mypassword",
    "port": 1234,
    "host": "",
    "protocol": "mongodb+srv",
    "prefix": "hb_",
    "options": {
        "authSource": "admin"

About using the prefix

If you're adding a prefix to an existing HashBrown instance, you need to move your databases in order to rename them. Here's an example of how to rename your databases:

$ mongo

$ use users
$ db.copyDatabase("users", "hb_users", "localhost")
$ db.dropDatabase()

$ use schedule
$ db.copyDatabase("schedule", "hb_schedule", "localhost")
$ db.dropDatabase()

$ use 876123hgj1376
$ db.copyDatabase("876123hgj1376", "hb_876123hgj1376", "localhost")
$ db.dropDatabase()

MongoDB options as environment variables

To override any of the above mentioned config parameters, they can be specified as environment variables, like so:

$ MONGODB_HOST="" node hashbrown.js

More information on the available options for MongoDB can be found here