Revision 70fa116eefce220901614378302b1233aff79934 authored by Valeri Karpov on 24 July 2023, 14:39:14 UTC, committed by Valeri Karpov on 24 July 2023, 14:39:14 UTC
1 parent ae3894c
auth.js
'use strict';
const Server = require('mongodb-topology-manager').Server;
const mongodb = require('mongodb');
run().catch(error => {
console.error(error);
process.exit(-1);
});
async function run() {
// Create new instance
const server = new Server('mongod', {
auth: null,
dbpath: '/data/db/27017'
});
// Purge the directory
await server.purge();
// Start process
await server.start();
const db = await mongodb.MongoClient.connect('mongodb://127.0.0.1:27017/admin');
await db.addUser('passwordIsTaco', 'taco', {
roles: ['dbOwner']
});
console.log('done');
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...