<!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>Callback When Updating Documents</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.log-cmd-insert.html">log_cmd_insert</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.log-getmore.html">log_getmore</a></div> <div class="up"><a href="mongo.context.html">Stream Context Options</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.log-cmd-update" class="refentry"> <div class="refnamediv"> <h1 class="refname">log_cmd_update</h1> <p class="verinfo">(PECL mongo >= 1.5.0)</p><p class="refpurpose"><span class="refname">log_cmd_update</span> — <span class="dc-title">Callback When Updating Documents</span></p> </div> <div class="refsect1 description" id="refsect1-function.log-cmd-update-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="methodname"><strong>log_cmd_update</strong></span> ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$server</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$writeOptions</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$updateOptions</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$protocolOptions</code></span> )</div> <p class="para rdfs-comment"> A <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> function, used by the <a href="context.mongodb.html#context.mongodb.log-cmd-update" class="link">log_cmd_update context option</a>, when updateing a document </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This is <em class="emphasis">not</em> a real function, only a prototype of how the function should be. </p> </p></blockquote> </div> <div class="refsect1 parameters" id="refsect1-function.log-cmd-update-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <code class="parameter">server</code> </dt> <dd> <p class="para"> An array containing the basic information about the server that was picked. <table class="doctable informaltable"> <thead> <tr> <th>key</th> <th>value</th> </tr> </thead> <tbody class="tbody"> <tr> <td>hash</td> <td>server hash, example: <em>localhost:27017;-;X;56052</em></td> </tr> <tr> <td>type</td> <td>Node type (primary/secondary/mongos/arbiter): <em>2</em></td> </tr> <tr> <td>max_bson_size</td> <td>The maximum BSON Size over the wire this node accepts: <em>16777216</em></td> </tr> <tr> <td>max_message_size</td> <td>The maximum Message Size over the wire this node accepts: <em>48000000</em></td> </tr> <tr> <td>request_id</td> <td>The request identifier for this message: <em>42</em></td> </tr> </tbody> </table> </p> </dd> <dt> <code class="parameter">writeOptions</code> </dt> <dd> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>key</th> <th>value</th> </tr> </thead> <tbody class="tbody"> <tr> <td>ordered</td> <td>boolean, if the operation (in case of batch operation) must be executed sequentually (ordered=true)</td> </tr> <tr> <td>writeConcern</td> <td>An array of writeConcern options (see below)</td> </tr> </tbody> </table> <table class="doctable table"> <caption><strong>writeConcern array values</strong></caption> <thead> <tr> <th>key</th> <th>value</th> </tr> </thead> <tbody class="tbody"> <tr> <td>fsync</td> <td>boolean, force flushing to disk before returning</td> </tr> <tr> <td>j</td> <td>boolean, force journal write before returning</td> </tr> <tr> <td>wtimeout</td> <td>integer, milliseconds, maximum time the primary is allowed to wait to verify replication</td> </tr> <tr> <td>w</td> <td>integer=server count, or string=replication-tag</td> </tr> </tbody> </table> </p> </dd> <dt> <code class="parameter">updateOptions</code> </dt> <dd> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>key</th> <th>value</th> </tr> </thead> <tbody class="tbody"> <tr> <td>multi</td> <td>Boolean, true if this update is allowed to update all matched criteria</td> </tr> <tr> <td>upsert</td> <td>Boolean, true if the document should be created if criteria does not match</td> </tr> <tr> <td>q</td> <td>Array, the search criteria</td> </tr> <tr> <td>u</td> <td>Array, the new object/modifications</td> </tr> </tbody> </table> </p> </dd> <dt> <code class="parameter">protocolOptions</code> </dt> <dd> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>key</th> <th>value</th> </tr> </thead> <tbody class="tbody"> <tr> <td>message_length</td> <td>The total size (in bytes) of the encoded message being sent over the wire</td> </tr> <tr> <td>request_id</td> <td>The request identifier for this message: <em>42</em></td> </tr> <tr> <td>namespace</td> <td>The MongoDB namespace used for the protocol message <em>dbname.collectionname</em></td> </tr> </tbody> </table> </p> </dd> </dl> </div> <div class="refsect1 changelog" id="refsect1-function.log-cmd-update-changelog"> <h3 class="title">Changelog</h3> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>1.5.0</td> <td> Only available when connected to MongoDB 2.6.0+ </td> </tr> </tbody> </table> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.log-cmd-insert.html">log_cmd_insert</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.log-getmore.html">log_getmore</a></div> <div class="up"><a href="mongo.context.html">Stream Context Options</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>