略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoGridFS::remove

2024-12-23

MongoGridFS::remove

(PECL mongo >=0.9.0)

MongoGridFS::removeRemove files and their chunks from the database

说明

public MongoGridFS::remove ([ array $criteria = array() [, array $options = array() ]] ) : bool|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.

add a note add a note

User Contributed Notes 1 note

up
0
fhagard at lightcube dot us
9 years ago
To ensure that a remove occurred successfully use MongoDB::lastError(). Currently MongoGridFS::remove will return even if the remove failed.

官方地址:https://www.php.net/manual/en/mongogridfs.remove.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3