Moving a user to a different database

In the createUser lab I created my user but the tests are still failing.

> db.getUser("m103-application-user")
{
        "_id" : "test.m103-application-user",
        "user" : "m103-application-user",
        "db" : "test",
        "roles" : [
                {
                        "role" : "readWrite",
                        "db" : "applicationData"
                }
        ],
        "mechanisms" : [
                "SCRAM-SHA-1",
                "SCRAM-SHA-256"
        ]
}

What am I missing here?

Hmm… looks like my user got created on the test db and should have been created on the admin db? How do I specify the db to which the user should be added to?

Never mind. I figured it out. Had to first switch to the admin db. My bad. :slight_smile:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.