Managed MongoDB
Provision and scale MongoDB databases effortlessly on the Abasthan Platform.
1. Provisioning
Select "MongoDB" from the + Create App menu. You can choose from various plans based on your required RAM, CPU, and storage.
2. Connection Details
Once provisioned, Abasthan provides a standard MongoDB connection string. This string includes your unique username, password, and the internal hostname.
3. Security
By default, your MongoDB instance is only accessible within your Abasthan private network. This ensures that your data remains secure from external threats.
4. Integration
When you create or update a web service, you can link it to your MongoDB instance. Abasthan will automatically inject the connection string as an environment variable (typically MONGODB_URI).
// Example connection in Node.js
const { MongoClient } = require('mongodb');
const uri = process.env.MONGODB_URI;
const client = new MongoClient(uri);
async function run() {
try {
await client.connect();
console.log("Connected to MongoDB");
} finally {
await client.close();
}
}
run().catch(console.dir);