update() public method
Updates the rows, which matches given criteria by given data.
Note: for "multiple" 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 ( $collection, $condition, $newData, $options = [] ) | ||
---|---|---|
$collection | array|string |
Collection name. |
$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. |
Please login to continue.