I was wondering why this answer is correct:
expect(clientOptions.authSource).toBe(“admin”)
In the documentation it is stated that:
“Specify the database name associated with the user’s credentials. [ authSource
] defaults to the database specified in the connection string.” - https://docs.mongodb.com/manual/reference/connection-string/#urioption.authSource
The database specified in the connection string is test:
mongodb+srv://m220-user:m220-pass@m220-test.mongodb.net/test
So why is the documentation saying different?