MongoDB Authentication Failed With Spring Data URI

UPDATE:
I have now resolved my problem. This is what happend:
I wanted to learn how to use a MongoDB instance from a Docker container instead of using my local MongoDB. I mapped the MongoDB container’s port 27017 to the computers localhost 27017. When running the Spring Application, MongoDB seemed to respond. It was only when I tried to performe CRUD-operations that authentication failed. Finally I realized that the localhost 27017 was already in use by the local MongoDB. Thus, I mapped the MongoDB container to port 8094 on localhost, and now it seems to work fine. I hope this could be of any help to anyone.