mongodb\Collection update()

update() public method

Updates the rows, which matches given criteria by given data.

Note: for "multi" mode Mongo requires explicit strategy "$set" or "$inc" to be specified for the "newData". If no strategy is passed "$set" will be used.

public integer|boolean update ( $condition, $newData, $options = [] )
$condition array

Description of the objects to update.

$newData array

The object with which to update the matching records.

$options array

List of options in format: optionName => optionValue.

return integer|boolean

Number of updated documents or whether operation was successful.

throws yii\mongodb\Exception

on failure.

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

Please login to continue.