manage-accounts-service/infra/docker/mongo-init-scripts/init.js

13 lines
259 B
JavaScript
Raw Permalink Normal View History

2023-08-13 08:51:54 +00:00
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 }],
});