MongoDB Atlas परिचय
Atlas MongoDB की hosted cloud service है, इसलिए आपको servers install या manage किए बिना एक database मिलती है।
In this page:
Syntax
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
$ 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. #}
आम गलतियां
- अपना IP address allow करना भूल जाना
- password के साथ connection string commit करना
- गलत 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: