With this help, I created a super user in the mongo shell: Create Superuser in mongo
user: "try1"
passw: "hello"
In mongo cmd, I have 3 databases: 'admin', 'myDatabase' and 'local'.
Now I try to use this authorized connection to the database called 'myDatabase'.
mongoose.connect('mongodb://try1:hello@localhost:27017/myDatabase');
But this is the error I get:
name: 'MongoError',
message: 'Authentication failed.',
ok: 0,
errmsg: 'Authentication failed.',
code: 18,
codeName: 'AuthenticationFailed' }
Mongoose disconnected
Mongoose disconnected through ${msg}