Initial commit

This commit is contained in:
Luis Fernando Molina committed 2018-09-03 15:19:57 +02:00
commit f47e08fdcb
2409 files changed
+363607

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
'use strict';
const Server = require('mongodb-topology-manager').Server;
const co = require('co');
const mongodb = require('mongodb');
co(function*() {
// Create new instance
var server = new Server('mongod', {
auth: null,
dbpath: '/data/db/27017'
});
// Purge the directory
yield server.purge();
// Start process
yield server.start();
const db = yield mongodb.MongoClient.connect('mongodb://localhost:27017/admin');
yield db.addUser('passwordIsTaco', 'taco', {
roles: ['dbOwner']
});
console.log('done');
}).catch(error => {
console.error(error);
process.exit(-1);
});