Team Ai
Apppublic

Stryker-SC/Discord-Bot-VCMaster-JavaScript-Revamped

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
MONGODB_GUIDE.md48 linesDownload Raw Back to docs
1# Setting Up a Free MongoDB Database (MongoDB Atlas)2 3This guide shows you how to get a **free** MongoDB database for your Discord bot.4 5## Step 1: Create an Account61.  Go to [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register).72.  Sign up (you can use your Google/GitHub account).83.  Fill in the welcome questionnaire (answers don't matter much).9 10## Step 2: Create a Cluster111.  Select the **M0 Free** tier (top right or left option).122.  **Name**: Leave it as `Cluster0` or name it `DiscordBotDB`.133.  **Provider**: AWS (usually default).144.  **Region**: Choose the one closest to you (marked "Free Tier Available").155.  Click **Create**.16 17## Step 3: Security Setup (Important!)18You will be prompted to set up security.19 201.  **Username and Password**:21    *   Create a database user (e.g., `botadmin`).22    *   Auto-generate a password and **COPY IT**. You will need this later.23    *   Click **Create User**.242.  **IP Access List**:25    *   Click **Add My Current IP Address** (for local testing).26    *   **CRITICAL**: Also add `0.0.0.0/0` (Allow Access from Anywhere).27        *   Why? Hugging Face Spaces changes IPs dynamically. We need to allow the cloud to connect.28        *   In the "IP Address" field, type `0.0.0.0/0`.29        *   Description: `Allow Cloud Access`.30        *   Click **Add Entry**.313.  Click **Finish and Close**.32 33## Step 4: Get Connection String341.  On your dashboard, verify you are on the **Database** tab.352.  Click **Connect** on your cluster card.363.  Select **Drivers**.374.  You will see a connection string like this:38    ```39    mongodb+srv://botadmin:<db_password>@cluster0.abcde.mongodb.net/?retryWrites=true&w=majority&appName=Cluster040    ```415.  **Copy this string**.42 43## Step 5: Finalize Connection String441.  Paste the string into a notepad.452.  Replace `<db_password>` with the password you copied in Step 3.46    *   *Example*: If password is `password123`, the string becomes `mongodb+srv://botadmin:password123@...`.473.  This is your **MONGO_URI**. Use this in your `.env` file or Hugging Face Secrets.48