---
title: "Database"
description: "Within the section mongodb the connection to the MongoDB database is configured."
stack: "Enterprise Stack (commercial) — version 0.21.0"
stack_version: "0.21.0"
stack_comparison: https://docs.walt.id/community-vs-enterprise.md
canonical_url: https://docs.walt.id/enterprise-stack/setup/configurations/config-files/database
generated: 2026-07-20
---
# Database

```[database.conf]
# Default datbase configuration

databaseType = mongodb

# Recommended storage driver that stores data in MongoDB. MongoDB Community Edition is supported.
mongodb = {
    # Refer to https://www.mongodb.com/docs/manual/reference/connection-string/
    connectionString = "mongodb://root:password@mongo:27017/"

    # Connection String quick reference:
    # - if username/password contain special characters, they must be converted with percent encoding (RFC3986 2.1)
    #
    # Format: mongodb+srv://[username:password@]host[/[defaultauthdb][?options]]
    #
    # EXAMPLES:
    #
    # Standard:
    # 1. Standalone:   mongodb://user:password@host:port/
    # 2. Shared cluster: mongodb://user:password@host1:port1,host2:port2,host3:port3/   (`mongos` hosts in connection string)
    # 3. Replica set: mongodb://user:password@host1:port1,host2:port2,host3:port3/?&replicaSet=replicaSetName
    #
    # SRV format (see https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist)
    # "DNS-constructed seed list to construct available servers list"
    # Examples: same as above, with `mongodb+srv://` instead of `mongodb://`

    # Database name
    
    database = "waltid-enterprise"

    ssl = {
        # To enable SSL
        enable = false

        # Location of the JKS Trust Store file
        trustStoreLocation = ""

        # Trust Store password
        trustStorePassword = ""

        # Toggle SSL certificate host name validation
        invalidHostNameAllowed = false
    }
}
```
# Database access

Within the section ***mongodb*** the connection to the MongoDB database is configured.

The property ***connectionString*** defines the authentication as well as the domain and port where the database is hosted. Furthermore, MongoDB options can be passed as URL parameters e.g. &readPreference=secondaryPreferred&retryWrites=false.

The ***database*** property indicates what database is selected within the database server.

# SSL configuration

The section ***ssl*** is for configuring the SSL connection as well as the corresponding Trust Store.

In order to enable ssl, the property ***enable*** must be set to true. A Trust Store is attached by setting the corresponding path to a Java Key Store (JKS) file. Note, that the AWS Trust Store is already part of the package and can be referenced by "config/aws-truststore.jks" and by setting the password to "123456". It is however recommend to substitute this file by providing an own Trust Store.

The property ***invalidHostNameAllowed*** may be toggled if the hostname of the provided certificates should be matched against the servers host name or not. In production settings it should be set to false.
