The driver can incorrectly send OP_QUERY to mongos with a read preference like:
{$readPreference:{mode:'secondary'}}
mongos 2.4 returns "BadValue: cannot canonicalize query". Later mongoses accept this format. Regardless, according to Server Selection Spec, if the query filter is empty it must be included anyway:
{$query:{}, $readPreference:{mode:'secondary'}}
This format works with all supported versions of mongos.
- is duplicated by
-
CDRIVER-986 OP_QUERY can be sent with $readPreference but no $query
- Closed