Closed MarkusAnthony closed 4 years ago
I think you may have created this issue at the wrong repo, but anyhow, the easiest way is to specify authSource in the uri
const uri = 'mongodb://monguser:mongpass@192.168.1.1:27017/DATABASE?authSource=admin';
If you need more info, see this issue https://github.com/Automattic/mongoose/issues/3905
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.
I'm submitting a...
Current behavior
I want to authenticate against "admin" database but open another database.
Expected behavior
I would like to specify the database I want to "open" and query against.
Minimal reproduction of the problem with instructions
app.module.ts
Connection string:
mongodb://<myuser>>:<<mypwd>>#@<<myserver>:27017/admin
What is the motivation / use case for changing the behavior?
Environment