mongo-typescript-example
mongo-typescript-example copied to clipboard
ormconfig setting for authenticationDatabase
Is there a setting for authenticationDatabase option in the ormconfig.json?
All the examples show no authentication at all.
THanks.
I just ran into this same issue and found there's an option in ormconfig.json
called extra
:
extra - Extra connection options to be passed to the underlying driver. Use it if you want to pass extra settings to underlying database driver. (from Common Connection Options)
So here's how you can set an auth database:
{
"extra": {
"authSource": "admin"
}
}
But I agree there should be an example in the documentation, this use-case seems to be rather frequent.