DEV Community

Cover image for Connect MongoDB Atlas and upload data :
Rahul Kumar
Rahul Kumar

Posted on

Connect MongoDB Atlas and upload data :

What is MongoDB atlas :

It is a database as a service where we could upload our data to the popular cloud providers such as AWS , azure, GCP .

Alt Text

setup :

  1. Crate a new project .
    Alt Text

  2. Select the free tire and then choose the cloud provider .
    Alt Text

  3. Navigate to the create a new user under the security section and then add a new user with password .

  4. and finally we can click on the connect button and then click on connect to our application .

  5. Then integrate that URI in your application with your username and password .

Here i am using node.js with mongoose as an odm(object document mapper)

mongoose.connect('mongodb+srv://admin:<password>@cluster0.jaomd.mongodb.net/<dbname>?retryWrites=true&w=majority', {useNewUrlParser: true});
Enter fullscreen mode Exit fullscreen mode
  • replace with your username , password and dbname .

  • Now we can execute CRUD operations on our database .

Top comments (0)