← Back to MongoDB Course | Chapter 1: Introduction | Lesson 6 of 7

MongoDB Atlas परिचय

Atlas MongoDB की hosted cloud service है, इसलिए आपको servers install या manage किए बिना एक database मिलती है।

In this page:

  1. MongoDB Atlas
Syntax
javascript
mongodb+srv://username:[email protected]/database_name
mongosh "connection_string"

MongoDB Atlas

cloud.mongodb.com पर एक free cluster बनाएँ, एक database user add करें, Network Access में अपना IP address allow करें, और connection string copy करें। mongodb+srv scheme DNS के जरिए cluster ढूंढता है। Atlas backups, scaling, और upgrades handle करता है।

Note: Free M0 tier सीखने और छोटे projects के लिए काफी है।

उदाहरण: MongoDB Atlas

bash
$ mongosh "mongodb+srv://cluster0.abcde.mongodb.net/shop" --username appUser
Enter password: ********
Atlas atlas-abc123-shard-0 [primary] shop>

// In Node.js, keep the string in an environment variable
const uri = process.env.MONGODB_URI;   // mongodb+srv://appUser:<password>@cluster0.abcde.mongodb.net/shop

⚠️ Run this in your own terminal or Node.js environment.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. अपना IP address allow करना भूल जाना
  2. password के साथ connection string commit करना
  3. गलत database user इस्तेमाल करना
चैप्टर सारांश
  • Atlas hosted MongoDB है
  • एक cluster और एक database user बनाएँ
  • Network access में अपना IP allow करें
  • एक mongodb+srv string से connect करें
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.