LearnBoost/mongoose — pull request #2490 by kjvalencik (2014-11-22 15:18:37+00:00)
Title: Fix recursive `readPref`

When using discriminators, `readPref` is called for each schema which causes an incorrectly nested read preference (e.g., `{"_type":"ReadPreference","mode":{"_type":"ReadPreference","mode":{"_type":"ReadPreference","mode":{"_type":"ReadPreference","mode":"secondaryPreferred"}}}}`).

This will ensure that if the `read` key is already a `ReadPref` object that we do not wrap it again.