<!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 Reading the MongoDB reply</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.log-killcursor.html">log_killcursor</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.log-write-batch.html">log_write_batch</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-reply" class="refentry"> <div class="refnamediv"> <h1 class="refname">log_reply</h1> <p class="verinfo">(PECL mongo >= 1.5.0)</p><p class="refpurpose"><span class="refname">log_reply</span> — <span class="dc-title">Callback When Reading the MongoDB reply</span></p> </div> <div class="refsect1 description" id="refsect1-function.log-reply-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="methodname"><strong>log_reply</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">$messageHeaders</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$operationHeaders</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-reply" class="link">log_reply context option</a>, when reading a reply from MongoDB. </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-reply-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">messageHeaders</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>length</td> <td>integer, bytes, message reply length</td> </tr> <tr> <td>request_id</td> <td>integer, the server request identifier</td> </tr> <tr> <td>response_id</td> <td>integer, the driver request identifier this message is a response of</td> </tr> <tr> <td>opcode</td> <td>integer, the opcode id</td> </tr> </tbody> </table> </p> </dd> <dt> <code class="parameter">operationHeaders</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>flags</td> <td>integer, bitmask of protocol flags</td> </tr> <tr> <td>cursor_id</td> <td>integer, ID of the cursor created on the server (0 if none created, or its been exhausted)</td> </tr> <tr> <td>start</td> <td>The starting offset of this cursor</td> </tr> <tr> <td>returned</td> <td>integer, how many documents are returned in this trip</td> </tr> </tbody> </table> </p> </dd> </dl> </div> <div class="refsect1 seealso" id="refsect1-function.log-reply-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member">The <a href="https://docs.mongodb.com/meta-driver/latest/legacy/mongodb-wire-protocol/" class="link external">» OP_REPLY definition in the Wire Protocol</a></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.log-killcursor.html">log_killcursor</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.log-write-batch.html">log_write_batch</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>