M103: Create first application user

Hello, I’m working to create my first application user. It appears as though I’ve correctly completed the steps when I check db.getUsers() from the db.applicationData database. However, results from running the test, turn back as if I’m 0/3 correct.

Steps taken.

mongod --port 27000

use admin

db.auth( ‘m103-admin’, ‘m103-pass’ )

use applicationData

db.getUsers() ###No users return

db.createUser({
… user: “m103-application-user”,
… pwd: “m103-application-pass”,
… roles: [
… {role: “readWrite”, db: “applicationData”}
… ]
… })

notice here when I run db.getUsers() it returns that my user is created insight the applicationData database.

image

however I’m failing all three steps.

Any tips or something simple that I may be missing? Thank you in advance.

First FAIL, Did you create the m103-application-user on the admin database?

When you executed

after

you switch from the admin database to the applicationData and then your

created the user in the applicationData database rather than the admin database.

2 Likes

Thank you! This did resolve.

1 Like