docker exec -it [CONTAINER_ID] mongosh
b) Create the user with credentials from .env
file`:
use admin
db.createUser({
user: "[username]",
pwd: "[password]",
roles: [{ role: "root", db: "admin" }]
})
c) Set profiler:
db.auth("[username]", "[password]")
use [db_name]
db.setProfilingLevel(1, { slowms: 0, filter: { "command.comment": "backend_query" } })