Question on Root User

If you create a Replica Set and you create your root user, why is it that you have to log out and back in using the long string: (mongo --port 27004 -u m103-admin -p m103-pass --authenticationDatabase admin)?

I tried to use the db.auth(m103-admin, m103-pass) method and it registered as 1 meaning it executed successfully, however it would not allow me to add to a replica set. I couldn’t run rs.add() until I logged out and back in using the long method? Why is that? It seems that it calls the same function. What am I missing?

This was explained during the first week of the training I believe. But I’m a bit vague on the details myself :wink: