public function update($expression, $updateData, array $options = array())
{
// execute update operator
$result = $this->getMongoCollection()->update(Expression::convertToArray($expression), Operator::convertToArray($updateData), $options);
// if write concern acknowledged
if (is_array($result)) {
if ($result['ok'] != 1) {
throw new Exception(sprintf('Update error: %s: %s', $result['err'], $result['errmsg']));
}
return $this;
}
// if write concern unacknowledged
if (!$result) {
throw new Exception('Update error');
}
return $this;
}