पाठ 2 / 22

मोंगोडीबी और mongosh इंस्टॉल करें

मोंगोडीबी को लोकल पर चलाएँ और शेल से कनेक्ट करें।

कम्युनिटी एडिशन इंस्टॉल करें

मुफ़्त, ओपन-सोर्स, और हर बड़े OS के लिए उपलब्ध।

# macOS (Homebrew)
brew tap mongodb/brew
brew install mongodb-community

# Ubuntu: follow MongoDB's apt repo instructions
# Windows: use the official .msi installer

सर्वर शुरू करें

mongod डेटाबेस सर्वर प्रोसेस है — यह डिफ़ॉल्ट रूप से पोर्ट 27017 पर सुनता है।

brew services start mongodb-community
# or run directly:
mongod --dbpath /data/db

mongosh से कनेक्ट करें

mongosh मोंगोडीबी पर कमांड चलाने के लिए आधुनिक इंटरैक्टिव शेल है।

mongosh
# connects to mongodb://127.0.0.1:27017 by default

Output:

Current Mongosh Log ID: ...
Connecting to: mongodb://127.0.0.1:27017/
test>

मोंगोडीबी कंपास

Compass आधिकारिक GUI है — डेटाबेस देखें, क्वेरी चलाएँ, और सब कुछ टाइप किए बिना इंडेक्स को दृश्य रूप से देखें।