PHP Portal » PHP Handbuch » MongoCollection::remove

Werbung

MongoCollection::remove


(PECL mongo >=0.9.0)

MongoCollection::removeRemove records from this collection

Beschreibung

public boolean MongoCollection::remove ( array $criteria [, boolean $justOne = FALSE ] )

Parameter-Liste

criteria

Description of records to remove.

justOne

Remove at most one record matching this criteria.

Rückgabewerte

Returns if the command was executed successfully.

Beispiele

PHP Code
1
2
3
4
5
6
7
8
9
$radioactive = $db->radioactive; // count how much more plutonium there is $remaining = $radioactive->count(array('type' => 94)); $halflife = $remaining/2; // remove half of it while ($halflife > 0) { $uranium->remove(array('type' => 94), true); $halflife--; }