<!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>Remove files and their chunks from the database</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongogridfs.put.html">MongoGridFS::put</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongogridfs.storebytes.html">MongoGridFS::storeBytes</a></div> <div class="up"><a href="class.mongogridfs.html">MongoGridFS</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mongogridfs.remove" class="refentry"> <div class="refnamediv"> <h1 class="refname">MongoGridFS::remove</h1> <p class="verinfo">(PECL mongo >=0.9.0)</p><p class="refpurpose"><span class="refname">MongoGridFS::remove</span> — <span class="dc-title">Remove files and their chunks from the database</span></p> </div> <div class="refsect1 description" id="refsect1-mongogridfs.remove-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><span class="type bool|array">bool|array</span></span> <span class="methodname"><strong>MongoGridFS::remove</strong></span> ([ <span class="methodparam"><span class="type">array</span> <code class="parameter">$criteria</code><span class="initializer"> = array()</span></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code><span class="initializer"> = array()</span></span> ]] )</div> </div> <div class="refsect1 parameters" id="refsect1-mongogridfs.remove-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <code class="parameter">criteria</code> </dt> <dd> <p class="para"> The filename or criteria for which to search. </p> </dd> <dt> <code class="parameter">options</code> </dt> <dd> <p class="para"> An array of options for the remove operations executed against the <em>chunks</em> and <em>files</em> collections. See <span class="function"><a href="mongocollection.remove.html" class="function">MongoCollection::remove()</a></span> for documentation on these options. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-mongogridfs.remove-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns an array containing the status of the removal (with respect to the <em>files</em> collection) if the <em>"w"</em> option is set. Otherwise, returns <strong><code>TRUE</code></strong>. </p> <p class="para"> Fields in the status array are described in the documentation for <span class="function"><a href="mongocollection.insert.html" class="function">MongoCollection::insert()</a></span>. </p> </div> <div class="refsect1 errors" id="refsect1-mongogridfs.remove-errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para">Throws <a href="class.mongocursorexception.html" class="classname">MongoCursorException</a> if the <em>"w"</em> option is set and the write fails.</p><p class="para">Throws <a href="class.mongocursortimeoutexception.html" class="classname">MongoCursorTimeoutException</a> if the <em>"w"</em> option is set to a value greater than one and the operation takes longer than <var class="varname"><var class="varname">MongoCursor::$timeout</var></var> milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in <var class="varname"><var class="varname">MongoCollection::$wtimeout</var></var> is milliseconds.</p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongogridfs.put.html">MongoGridFS::put</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongogridfs.storebytes.html">MongoGridFS::storeBytes</a></div> <div class="up"><a href="class.mongogridfs.html">MongoGridFS</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>