Cxx 440: Fix tests for 2.2

mongod doesn't know about read preference it only knows about the query's
slave_ok bit. Older versions of MongoDB are pickier about whether the
slave_ok is set or not for count.

On Wed, Dec 10, 2014 at 11:33 AM, Spencer Jackson <notifications@github.com>
wrote:

> In src/mongo/integration/replica_set/read_preference.cpp
> <https://github.com/mongodb/mongo-cxx-driver/pull/214#discussion-diff-21615158>
> :
>
> > @@ -94,7 +94,7 @@ namespace {
> >
> >      void count(const auto_ptr<DBClientReplicaSet>& test_conn, ReadPreference rp) {
> >          Query q = Query().readPref(rp, BSONArray());
> > -        test_conn->count(TEST_NS, q);
> > +        test_conn->count(TEST_NS, q, QueryOption_SlaveOk);
>
> 2.2 doesn't seem to respect the read preference on count, and will throw
> "count fails:{ errmsg: "not master", note: "from execCommand", ok: 0.0 }".
> I could make this parameter conditional upon the version?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mongodb/mongo-cxx-driver/pull/214/files#r21615158>.
>