On Fri, 4 Jan 2013, Manasi Sahasrabudhe wrote:
> mongodb-php-driver that we are using is old. Currently we are on 1.2.10. I
> tried upgrading to 1.3.2 and did not see this error during my initial
> testing.
> However I have 2 related questions,
> 1. Currently we are calling SlaveOkay methods because we would like to send
> reads to secondaries. However once we upgrade our php-client to newer
> version we wont be able to use those as they are deprecated.
How are you calling slaveOkay, directly on the cursor (and on every
cursor)? If it's through every one, you can set a read preference in
general, either in the constructor or on the connection, database or
collection level:
http://php.net/manual/en/mongodb.setreadpreference.php
and
http://php.net/manual/en/mongo.readpreferences.php
We'll be adding a per-cursor setReadPreference soon:
https://jira.mongodb.org/browse/PHP-483
> 2. We are running MongoDB 2.0.6 on db server which does not support
> ReadPreferences (as it was introduced in 2.2). So whats the compatible
> version of mongo-php-driver with mongodb 2.0.6? and with which we still be
> able to use slaveokay or similar?
This is all implemented in the driver, and not in the database. So the
1.3 series should work just fine with 2.0.6 - although there are/were
some issues in case you are using sharding that we are figuring out and
fixing.
cheers,
Derick
--
{
website: [ "
http://mongodb.org", "
http://derickrethans.nl" ],
twitter: [ "@derickr", "@mongodb" ]
}