MongoDB connection string not honouring readPreference

Just been talking with support about this. Apparently, you have a hardcoded readPreference of "primaryPreferred" in the MongoDB connection string.

This means that any MongoDB queries are made to the primary replica of a Mongo cluster. This might not be desirable as it adds load on the most important cluster member and can be avoided by using read replicas if the action is read-only and data freshness is not in high priority.

We've been told to open a feature request about this behaviour to allow users to supplement this with their preferred behaviour.

1 Like