<!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>The MongoDB\Driver\WriteResult class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongodb-driver-writeerror.getmessage.html">MongoDB\Driver\WriteError::getMessage</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongodb-driver-writeresult.getdeletedcount.html">MongoDB\Driver\WriteResult::getDeletedCount</a></div> <div class="up"><a href="book.mongodb.html">MongoDB\Driver</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.mongodb-driver-writeresult" class="reference"> <h1 class="title">The MongoDB\Driver\WriteResult class</h1> <div class="partintro"><p class="verinfo">(mongodb >=1.0.0)</p> <div class="section" id="mongodb-driver-writeresult.intro"> <h2 class="title">Introduction</h2> <p class="para"> The <strong class="classname">MongoDB\Driver\WriteResult</strong> class encapsulates information about an executed <a href="class.mongodb-driver-bulkwrite.html" class="classname">MongoDB\Driver\BulkWrite</a> and may be returned by <span class="methodname"><a href="mongodb-driver-manager.executebulkwrite.html" class="methodname">MongoDB\Driver\Manager::executeBulkWrite()</a></span>. </p> </div> <div class="section" id="mongodb-driver-writeresult.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="modifier">final</span> <span class="ooclass"> <strong class="classname">MongoDB\Driver\WriteResult</strong> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">integer|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getdeletedcount.html" class="methodname">getDeletedCount</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">integer|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getinsertedcount.html" class="methodname">getInsertedCount</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">integer|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getmatchedcount.html" class="methodname">getMatchedCount</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">integer|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getmodifiedcount.html" class="methodname">getModifiedCount</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">MongoDB\Driver\Server</span> <span class="methodname"><a href="mongodb-driver-writeresult.getserver.html" class="methodname">getServer</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">integer|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getupsertedcount.html" class="methodname">getUpsertedCount</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="mongodb-driver-writeresult.getupsertedids.html" class="methodname">getUpsertedIds</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">MongoDB\Driver\WriteConcernError|null</span> <span class="methodname"><a href="mongodb-driver-writeresult.getwriteconcernerror.html" class="methodname">getWriteConcernError</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="mongodb-driver-writeresult.getwriteerrors.html" class="methodname">getWriteErrors</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="mongodb-driver-writeresult.isacknowledged.html" class="methodname">isAcknowledged</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mongodb-driver-writeresult.getdeletedcount.html">MongoDB\Driver\WriteResult::getDeletedCount</a> — Returns the number of documents deleted</li><li><a href="mongodb-driver-writeresult.getinsertedcount.html">MongoDB\Driver\WriteResult::getInsertedCount</a> — Returns the number of documents inserted (excluding upserts)</li><li><a href="mongodb-driver-writeresult.getmatchedcount.html">MongoDB\Driver\WriteResult::getMatchedCount</a> — Returns the number of documents selected for update</li><li><a href="mongodb-driver-writeresult.getmodifiedcount.html">MongoDB\Driver\WriteResult::getModifiedCount</a> — Returns the number of existing documents updated</li><li><a href="mongodb-driver-writeresult.getserver.html">MongoDB\Driver\WriteResult::getServer</a> — Returns the server associated with this write result</li><li><a href="mongodb-driver-writeresult.getupsertedcount.html">MongoDB\Driver\WriteResult::getUpsertedCount</a> — Returns the number of documents inserted by an upsert</li><li><a href="mongodb-driver-writeresult.getupsertedids.html">MongoDB\Driver\WriteResult::getUpsertedIds</a> — Returns an array of identifiers for upserted documents</li><li><a href="mongodb-driver-writeresult.getwriteconcernerror.html">MongoDB\Driver\WriteResult::getWriteConcernError</a> — Returns any write concern error that occurred</li><li><a href="mongodb-driver-writeresult.getwriteerrors.html">MongoDB\Driver\WriteResult::getWriteErrors</a> — Returns any write errors that occurred</li><li><a href="mongodb-driver-writeresult.isacknowledged.html">MongoDB\Driver\WriteResult::isAcknowledged</a> — Returns whether the write was acknowledged</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongodb-driver-writeerror.getmessage.html">MongoDB\Driver\WriteError::getMessage</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongodb-driver-writeresult.getdeletedcount.html">MongoDB\Driver\WriteResult::getDeletedCount</a></div> <div class="up"><a href="book.mongodb.html">MongoDB\Driver</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>