public update ( array | string $collection, array $condition, array $newData, array $options = [] ) : integer | boolean | ||
$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. |
public function update($collection, $condition, $newData, $options = [])
{
$this->beginProfile($token = " > update " . $this->composeCollectionLogName($collection) . ") ...");
$result = $this->db->getCollection($collection)->update($condition, $newData, $options);
$this->endProfile($token);
return $result;
}