manage-accounts-service/infra/docker/mongo-init-scripts/init.js
2023-08-13 11:51:54 +03:00

12 lines
259 B
JavaScript

const username = 'example_user';
const password = 'example_password';
const dbName = 'example_db';
const userRole = 'readWrite';
db = db.getSiblingDB(dbName);
db.createUser({
user: username,
pwd: password,
roles: [{ role: userRole, db: dbName }],
});