mongodb\ActiveRecord deleteAll()

deleteAll() public static method

Deletes documents in the collection using the provided conditions.

WARNING: If you do not specify any condition, this method will delete documents rows in the collection.

For example, to delete all customers whose status is 3:

Customer::deleteAll(['status' => 3]);
public static integer deleteAll ( $condition = [], $options = [] )
$condition array

Description of the objects to delete. Please refer to yii\mongodb\Query::where() on how to specify this parameter.

$options array

List of options in format: optionName => optionValue.

return integer

The number of documents deleted.

doc_Yii
2016-10-30 17:07:25
Comments
Leave a Comment

Please login to continue.