banner



How To Create Mongodb Database In Mlab

Quick-Start Guide to mLab

  • Step 1: Set up an mLab account
  • Step 2: Create a database subscription
  • Step 3: Connect to your new database
  • Step 4: Load some data
  • Everything else you need to know

Step 1: Set up an mLab account

To get started with mLab, you must first create your free mLab account. When that's complete, you can add as many database subscriptions as you want.

For additional information about managing your mLab account users, contacts, and billing, see mLab Account Setup.

Step 2: Create a database subscription

After you've created your account, add a new database subscription. Get started quickly at no cost with a free Sandbox database.

img-newsub

For detailed steps on how to add a subscription, see Database Subscriptions. For a discussion on how to choose the right plan for your subscription, see Plans and Data Centers.

Step 3: Connect to your new database

In a terminal window, connect to your database using the mongo shell (the command will look similar to the following example):

            % mongo ds012345.mlab.com:56789/dbname -u dbuser -p dbpassword                      

You can create a database user and password and grab your connection info after logging into your account and navigating to the database's home page:

img-connectstring

To view detailed connection instructions, troubleshooting tips, and alternate connection methods, see Connecting to Your Database.

Step 4: Load some data

Here's a quick exercise that tests an insertion into your new database:

  1. Assuming you successfully connected using the mongo shell in the previous step, run the following command:

                                      > db.mynewcollection.insert({ "foo" : "bar" })                              
  2. Next, run the command in the first line below and confirm that the shell output matches the second line (your "_id" value will be different):

                                      > db.mynewcollection.find()  { "_id" : ObjectId("526705b4a3559a176784b4af"), "foo" : "bar" }                              

For additional instructions on how to get data, including larger datasets, into your mLab database, see Migrating Data into mLab.

Everything else you need to know

Congratulations—you've successfully created an mLab database! You're now on your way to discovering more about mLab's services so be sure to read through our documentation to get the most out of mLab and your MongoDB deployment(s). We have a broad range of topics that covers all the information you need to know about working with your mLab-managed database(s).

Our Support page also links to some great MongoDB resources that you'll find super helpful.

Contact us

When in doubt, when you can't find specific information, or when you're just plain stuck, please don't hesitate to email us directly at support@mlab.com.

How To Create Mongodb Database In Mlab

Source: https://docs.mlab.com/

Posted by: sainanderser.blogspot.com

0 Response to "How To Create Mongodb Database In Mlab"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel