Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
legacy-1.0.2
Description
If the C++ driver wants to product a count or distinct command, with say, readPreference "secondary" - it will produce a command like this:
{distinct: <collection name>, key: <keyname>, query: {filter: "myvalue", $readPreference: "secondary"}
|
The correct form, according to the server selection spec, would be:
{$query: {distinct: <collection name>. key: <keyname>, query: {filter: "myvalue"}, $readPreference: "secondary}
|
The server historically accepted the first due to relatively imprecise rules for parsing read preference. As all drivers now follow the server selection spec method for attaching RP, the C++ driver should do the same.
This affects the helpers for count, distinct, mapreduce, and group.