<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mongodb-driver-manager.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'mongodb-driver-manager.executewritecommand.php',
    1 => 'MongoDB\\Driver\\Manager::executeWriteCommand',
    2 => 'Execute a database command that writes',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-driver-manager.php',
    1 => 'MongoDB\\Driver\\Manager',
  ),
  'prev' => 
  array (
    0 => 'mongodb-driver-manager.executereadwritecommand.php',
    1 => 'MongoDB\\Driver\\Manager::executeReadWriteCommand',
  ),
  'next' => 
  array (
    0 => 'mongodb-driver-manager.getencryptedfieldsmap.php',
    1 => 'MongoDB\\Driver\\Manager::getEncryptedFieldsMap',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/mongodb/driver/manager/executewritecommand.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-driver-manager.executewritecommand" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\Manager::executeWriteCommand</h1>
  <p class="verinfo">(mongodb &gt;=1.4.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\Manager::executeWriteCommand</span> &mdash; <span class="dc-title">Execute a database command that writes</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-manager.executewritecommand-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\Driver\Manager::executeWriteCommand</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$db</code></span>, <span class="methodparam"><span class="type"><a href="class.mongodb-driver-command.php" class="type MongoDB\Driver\Command">MongoDB\Driver\Command</a></span> <code class="parameter">$command</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.array.php" class="type array">array</a></span></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.mongodb-driver-cursor.php" class="type MongoDB\Driver\Cursor">MongoDB\Driver\Cursor</a></span></div>

  <p class="simpara">
   Executes the command on the primary server.
  </p>
  <p class="simpara">
   This method will apply logic that is specific to commands that write (e.g.
   <a href="https://www.mongodb.com/docs/manual/reference/command/drop/" class="link external">&raquo;&nbsp;drop</a>).
   The default value for the <code class="literal">&quot;writeConcern&quot;</code> option will be
   inferred from an active transaction (indicated by the
   <code class="literal">&quot;session&quot;</code> option), followed by the
   <a href="mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-uri" class="link">connection URI</a>.
  </p>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <span class="simpara">
    This method is not intended to be used to execute
    <a href="https://www.mongodb.com/docs/manual/reference/command/insert/" class="link external">&raquo;&nbsp;insert</a>,
    <a href="https://www.mongodb.com/docs/manual/reference/command/update/" class="link external">&raquo;&nbsp;update</a>,
    or <a href="https://www.mongodb.com/docs/manual/reference/command/delete/" class="link external">&raquo;&nbsp;delete</a>
    commands. Users are encouraged to use
    <span class="function"><a href="mongodb-driver-manager.executebulkwrite.php" class="function">MongoDB\Driver\Manager::executeBulkWrite()</a></span> for those
    operations.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-manager.executewritecommand-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
   
    <dt><code class="parameter">db</code> (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)</dt>
    <dd>
     <p class="para">
      The name of the database on which to execute the command.
     </p>
    </dd>
   

   
   
    <dt><code class="parameter">command</code> (<span class="classname"><a href="class.mongodb-driver-command.php" class="classname">MongoDB\Driver\Command</a></span>)</dt>
    <dd>
     <p class="para">
      The command to execute.
     </p>
    </dd>
   

   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <p class="para">
      <table class="doctable table">
       <caption><strong>options</strong></caption>
       
        <thead>
         <tr>
          <th>Option</th>
          <th>Type</th>
          <th>Description</th>
         </tr>

        </thead>

        <tbody class="tbody">
         
         <tr>
          <td>session</td>
          <td><span class="classname"><a href="class.mongodb-driver-session.php" class="classname">MongoDB\Driver\Session</a></span></td>
          <td>
           <p class="para">
            A session to associate with the operation.
           </p>
          </td>
         </tr>


         
         <tr>
          <td>writeConcern</td>
          <td><span class="classname"><a href="class.mongodb-driver-writeconcern.php" class="classname">MongoDB\Driver\WriteConcern</a></span></td>
          <td>
           <p class="para">
            A write concern to apply to the operation.
           </p>
          </td>
         </tr>


        </tbody>
       
      </table>

     </p>
     
     <div class="warning"><strong class="warning">Uyarı</strong>
      <p class="para">
       If you are using a <code class="literal">&quot;session&quot;</code> which has a transaction
       in progress, you cannot specify a <code class="literal">&quot;readConcern&quot;</code> or
       <code class="literal">&quot;writeConcern&quot;</code> option. This will result in an
       <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span>
       being thrown. Instead, you should set these two options when you create
       the transaction with
       <span class="methodname"><a href="mongodb-driver-session.starttransaction.php" class="methodname">MongoDB\Driver\Session::startTransaction()</a></span>.
      </p>
     </div>

    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-driver-manager.executewritecommand-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">Returns <span class="classname"><a href="class.mongodb-driver-cursor.php" class="classname">MongoDB\Driver\Cursor</a></span> on success.</p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-manager.executewritecommand-errors">
  <h3 class="title">Hatalar/İstisnalar</h3>
  <ul class="simplelist">
   <li>Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> if the <code class="literal">&quot;session&quot;</code> option is used with an associated transaction in combination with a <code class="literal">&quot;readConcern&quot;</code> or <code class="literal">&quot;writeConcern&quot;</code> option.</li>
   <li>Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> if the <code class="literal">&quot;session&quot;</code> option is used in combination with an unacknowledged write concern.</li>
   <li>Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> on argument parsing errors.</li><li>Throws <span class="classname"><a href="class.mongodb-driver-exception-connectionexception.php" class="classname">MongoDB\Driver\Exception\ConnectionException</a></span> if connection to the server fails (for reasons other than authentication).</li><li>Throws <span class="classname"><a href="class.mongodb-driver-exception-authenticationexception.php" class="classname">MongoDB\Driver\Exception\AuthenticationException</a></span> if authentication is needed and fails.</li>
   <li>Throws <span class="classname"><a href="class.mongodb-driver-exception-runtimeexception.php" class="classname">MongoDB\Driver\Exception\RuntimeException</a></span> on other errors (e.g. invalid command).</li>
  </ul>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongodb-driver-manager.executewritecommand-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Sürüm: </th>
      <th>Açıklama</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL mongodb 1.4.4</td>
      <td>
       <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span>
       will be thrown if the <code class="literal">&quot;session&quot;</code> option is used in
       combination with an unacknowledged write concern.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-driver-manager.executewritecommand-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <ul class="simplelist">
   <li><span class="classname"><a href="class.mongodb-driver-command.php" class="classname">MongoDB\Driver\Command</a></span></li>
   <li><span class="classname"><a href="class.mongodb-driver-cursor.php" class="classname">MongoDB\Driver\Cursor</a></span></li>
   <li><span class="function"><a href="mongodb-driver-manager.executecommand.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\Manager::executeCommand()</a> - Execute a database command</span></li>
   <li><span class="function"><a href="mongodb-driver-manager.executereadcommand.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\Manager::executeReadCommand()</a> - Execute a database command that reads</span></li>
   <li><span class="function"><a href="mongodb-driver-manager.executereadwritecommand.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\Manager::executeReadWriteCommand()</a> - Execute a database command that reads and writes</span></li>
   <li><span class="function"><a href="mongodb-driver-server.executewritecommand.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\Server::executeWriteCommand()</a> - Execute a database command that writes on this server</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>