> For the complete documentation index, see [llms.txt](https://docs.lidistat67.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lidistat67.eu/setting-up-mongodb.md).

# Setting Up MongoDB

To be able to store data such as logs, you will need to use your own database. A database is required, as the database also stores configuration data for your bot.

Upon creating an account, you will be greeted with this page. Make sure you select Starter Cluster. <br>

<figure><img src="/files/xhAc00cWZREMdYW5Y2Oi" alt=""><figcaption></figcaption></figure>

After this, you will be taken to the below screen: <br>

<figure><img src="/files/odnxGaiFja9KgZEj8Z0d" alt=""><figcaption></figcaption></figure>

Select one of the servers marked with `FREE TIER AVAILABLE` and click on `Create Cluster`. It will only take a couple of minutes to configure everything for you.

Follow the "Getting Started" tutorial on the bottom left.<br>

Go to the `Database Access` section in the `security` tab. Click on `+ Add New User` to create a new user, whereupon a new screen will pop up. `Select Read and write to any database`, so the bot can properly store the data. Choose a username and password, but make sure they both **don't contain any special character like** `!`, `-`, `?`. Copy the password into your notepad.

Finally, click `Add User` to finish the creation.<br>

<figure><img src="/files/AWLnokl19TX4hg9RtlVU" alt=""><figcaption></figcaption></figure>

Go to the `Network Access` section in the `security` tab. Click on `+ Add IP Address` to add an IP address, whereupon a new screen will pop up. Click the `Allow Access From Everywhere` button and `0.0.0.0/0` should appear in the `Whitelist Entry`. Otherwise, make sure to put input that manually. Finally, click `Confirm` to confirm your changes.<br>

<figure><img src="/files/bEI3QzPDAu79AYgng6s7" alt=""><figcaption></figcaption></figure>

The last part is to generate a Mongo URI. Go to the `Clusters` section in the `Atlas` tab. Click on `Connect` on the left side of your Cluster dashboard. This will open up a new screen where you have three options. For our purposes, select the middle option `Connect Your Application.` <br>

<figure><img src="/files/itEmwCtJTZJN2GCAB4EZ" alt=""><figcaption></figcaption></figure>

You need to copy the connection string, which can be easily done by clicking the `Copy` button. Remove everything past `<dbname>` but keeping the `/`. Then replace `<password>` with the password for your user and `<username>` with your database-username, which you set earlier. Paste the URI in your notepad.

The final URI looks similar to this:&#x20;

`mongodb+srv://Username:MyPassword@modmail-kjvn21.mongodb.net/.`<br>

<figure><img src="/files/C5vChrgT0gIkFthDceDx" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lidistat67.eu/setting-up-mongodb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
