db = db.getSiblingDB('user_db'); db.createUser({ user: "user", pwd: "12345", roles: [{ role: "readWrite", db: "user_db" }] });