pkgcloud
Version:
An infrastructure-as-a-service agnostic cloud library for node.js
30 lines (27 loc) • 506 B
JavaScript
var pkgcloud = require('../../lib/pkgcloud');
var client = pkgcloud.database.createClient({
provider: 'mongohq',
username: "bob",
password: "1234"
});
//
// Create a MongoDB
//
client.create({
name: "mongo-instance",
plan: "free",
}, function (err, result) {
//
// Check the result
//
console.log(err, result);
//
// Now delete that same MongoDB
//
client.remove(result.id, function(err, result) {
//
// Check the result
//
console.log(err, result);
});
});