I'm connecting to a remote database that is configured only for reading. If I use:
$connection = new \MongoClient($server);
$dbname = $connection->selectDB("db");
$dbname->setReadPreference(\MongoClient::RP_SECONDARY);
It works fine, but if I try:
$dm = $this->getDocumentManager(); //using remote db connection in config
$result = $dm->getRepository('Repository')->method();
I get this error:
not master and slaveOk=false
How can I specify the Read Preference to the $dm, same way as it works for the MongoClient?
Thanks in advance...