<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Change slaveOkay setting for this collection</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongocollection.setreadpreference.html">MongoCollection::setReadPreference</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongocollection.toindexstring.html">MongoCollection::toIndexString</a></div> <div class="up"><a href="class.mongocollection.html">MongoCollection</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mongocollection.setslaveokay" class="refentry"> <div class="refnamediv"> <h1 class="refname">MongoCollection::setSlaveOkay</h1> <p class="verinfo">(PECL mongo >=1.1.0)</p><p class="refpurpose"><span class="refname">MongoCollection::setSlaveOkay</span> — <span class="dc-title">Change slaveOkay setting for this collection</span></p> </div> <div class="refsect1 description" id="refsect1-mongocollection.setslaveokay-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>MongoCollection::setSlaveOkay</strong></span> ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$ok</code><span class="initializer"> = true</span></span> ] )</div> <p class="para rdfs-comment"> See <a href="mongo.queries.html" class="link">the query section</a> of this manual for information on distributing reads to secondaries. </p> </div> <div class="refsect1 parameters" id="refsect1-mongocollection.setslaveokay-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"> <em><code class="parameter">ok</code></em> </span> <dd> <p class="para"> If reads should be sent to secondary members of a replica set for all possible queries using this <a href="class.mongocollection.html" class="classname">MongoCollection</a> instance. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-mongocollection.setslaveokay-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the former value of slaveOkay for this instance. </p> </div> <div class="refsect1 changelog" id="refsect1-mongocollection.setslaveokay-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>1.2.11</td> <td>Emits <strong><code>E_DEPRECATED</code></strong> when used.</td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-mongocollection.setslaveokay-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"><a href="mongo.readpreferences.html" class="xref">Read Preferences</a></li> <li class="member"> <span class="methodname"><a href="mongocollection.setreadpreference.html" class="methodname" rel="rdfs-seeAlso">MongoCollection::setReadPreference()</a> - Set the read preference for this collection</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongocollection.setreadpreference.html">MongoCollection::setReadPreference</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongocollection.toindexstring.html">MongoCollection::toIndexString</a></div> <div class="up"><a href="class.mongocollection.html">MongoCollection</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>