Currently Mongoose doesn't support authenticating as an admin user and then using a different db.
This is something that can be easily done when using the native MongoDB driver by adding
authdb in the connection options (
MongoDB doc).
Changing Mongoose's authentication function seems to do the trick.
I have written a patch to allow this functionality but unfortunately my knowledge of both mongoose and tests are less than basic.
So, could someone check out if this is indeed the right way to do this and if possible point me as to how the tests for this functionality should be?
Thank you very much in advance.