harmonysoft.environment.testcontainers.mongo.mongo-user.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of harmonysoft-mongo-environment-testcontainers Show documentation
Show all versions of harmonysoft-mongo-environment-testcontainers Show documentation
Common general-purpose Kotlin utility
console.log("starting mongo user creation")
dbName = process.env.MONGO_INITDB_DATABASE
user = process.env.MONGO_NON_ROOT_USERNAME
password = process.env.MONGO_NON_ROOT_PASSWORD
db = db.getSiblingDB(dbName)
db.createUser(
{
user: user,
pwd: password,
roles: [{ role: "readWrite", db: dbName }],
},
);
console.log("finished mongo user creation")