©
本文档使用 PHP中文网手册 发布
(PECL mongo >=0.9.0)
MongoGridFS::remove — Remove files and their chunks from the database
$criteria
= array()
[, array $options
= array()
]] )
criteria
The filename or criteria for which to search.
options
An array of options for the remove operations executed against the chunks and files collections. See MongoCollection::remove() for documentation on these options.
Returns an array containing the status of the removal (with respect to the
files collection) if the "w" option is
set. Otherwise, returns TRUE
.
Fields in the status array are described in the documentation for MongoCollection::insert() .
Throws MongoCursorException if the "w" option is set and the write fails.
Throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds.
[#1] fhagard at lightcube dot us [2010-04-08 06:58:49]
To ensure that a remove occurred successfully use MongoDB::lastError(). Currently MongoGridFS::remove will return even if the remove failed.