Why does it automatically add sample data when creating a cluster every time?

Hi team, this is my first post in this community. I’m not sure if I chose the correct category; if not, please move this post to the right section. Thank you in advance. By the way, I wanted to share my issue. Two days ago, when I tried to create a cluster, I noticed there was an option to load a sample sheet, which was optional - meaning I could tick or untick it. So, I chose to untick it because I didn’t want to load the sample data sheet. However, today when I tried to create a new cluster, I didn’t see the option to select or deselect the sample data sheet, so it was automatically generated with the cluster and consumed almost 135 MB of my total cluster size. Is there a way for me to use my cluster without loading the sample sheet? Or is there any chance to bring back the previous version where there was an option to choose whether to load the sample sheet or not? I think this would be very useful for every user. I am waiting for your valuable reply.

Hey - sorry you’re having trouble with the sample data… I believe the option to automatically load sample data is now on M0 shared cluster instances. You always have the option to add sample data after the fact to any cluster. You can also always simply delete the sample data from the cluster you’ve deployed with the data.

Using the Atlas UI:

  1. Log in to MongoDB Atlas:

  2. Select Your Cluster:

    • From the Atlas dashboard, select the cluster from which you want to remove the sample datasets.
  3. Navigate to Collections:

    • Click on the “Collections” tab. This will open the Data Explorer for your selected cluster.
  4. Identify Sample Databases:

    • Look for the sample databases, typically named sample_<name>, such as sample_airbnb, sample_mflix, etc.
  5. Delete Sample Databases:

    • For each sample database you want to remove, click on the database name to expand its collections.
    • Click the “…” (ellipsis) next to the database name and select “Drop Database.”
    • Confirm the deletion in the prompt that appears.

Using the MongoDB Shell (mongosh):

  1. Connect to Your Cluster:

    • Open your terminal or command prompt and connect to your MongoDB Atlas cluster using the mongosh command.
    • The connection string looks something like this:

mongosh "mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority"

  1. List Databases:

    • List all databases to identify the sample datasets.

      show dbs

  2. Drop Sample Databases:

    • For each sample database you want to remove, switch to that database and drop it.
use sample_airbnb
        db.dropDatabase()
        
        use sample_mflix
        db.dropDatabase()

Repeat the above commands for each sample database.

Using MongoDB Atlas CLI:

  1. Install MongoDB Atlas CLI:

    • If you haven’t already, install the MongoDB Atlas CLI from here.
  2. Log in to MongoDB Atlas CLI:

    • Authenticate with your Atlas account.

      atlas auth login

  3. List Databases:

    • List all databases in your cluster to identify the sample datasets.

      atlas clusters list-databases <cluster-name>

  4. Delete Sample Databases:

    • For each sample database you want to remove, use the atlas clusters delete-database command.

      atlas clusters delete-database <cluster-name> sample_airbnb atlas clusters delete-database <cluster-name> sample_mflix

    • Repeat the command for each sample database.

1 Like