📌 Purpose & Quick Summary
Modern web applications, real-time APIs, and microservices often utilize document-oriented NoSQL databases. The MongoDB Databases hub in BoostonCP allows you to provision NoSQL databases with dedicated user authentication, obtaining clean connection URIs on Port 27017 for seamless integration into Node.js (Mongoose), Python (PyMongo), or Go backends.
Figure 11: MongoDB NoSQL database hub showing active databases, port 27017 status, and connection URIs.
🖥️ Interface Tour & Elements
- MongoDB Service Status Banner: Displays listener status on Port
27017. - Create Database Modal: Configuration dialog to define database name, user credentials, and authentication mechanism.
- Database Ledger: Table listing provisioned NoSQL databases, storage metrics, and action controls.
- Copy URI Utility: 1-click clipboard copy for connection strings with authentication source parameters.
🛠️ Step-by-Step Instructions
Step 1: Provisioning a MongoDB Database
- In the sidebar, click MongoDB DBs (icon:
fa-leaf). - Click Create MongoDB Database.
- Enter the database name and user credentials.
- Click Create Database. The MongoDB daemon initializes the database and creates user credentials with
readWriteroles.
Step 2: Connecting Your Application
- In the database ledger, click Copy Connection String.
- The URI is generated in standard format:
mongodb://username:[email protected]:27017/dbname?authSource=admin - Add this URI to your Node.js
.envfile asMONGO_URI.
⚙️ Complete Field & Parameter Reference Table
| Connection Parameter | Standard Value | Description |
|---|---|---|
| Host | 127.0.0.1 |
Local host connection preventing external port exposure. |
| Port | 27017 |
Standard MongoDB daemon listener port. |
| Auth Source | admin |
Default authentication database where user roles are verified. |
| Protocol | mongodb:// |
Standard NoSQL connection scheme. |
❓ Troubleshooting & Common Errors
1. Connection Error: "Authentication failed"
- Cause: Missing
?authSource=adminparameter in the connection string. - Solution: Always append
?authSource=adminto ensure MongoDB authenticates the user against the correct auth collection.