DEV Community

loading...
Cover image for Connect MongoDB Atlas and upload data :

Connect MongoDB Atlas and upload data :

Rahul Kumar
Hi geeks ....... I am a Passionate open source enthusiastic, looking for learning new technologies everyday.
・1 min read

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 .

Discussion (0)