Skip to content

Commit

Permalink
Do not perform update when no changes found.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Mar 22, 2017
1 parent d456c8f commit a45012f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public function update($model, $filter = null, array $options = [])
}

$update = $this->changesCollector->changes($model);
if (empty($update)) {
return;
}

$result = $this->collection->updateOne($filter, $update, $options);
if (false == $result->isAcknowledged()) {
Expand Down

0 comments on commit a45012f

Please sign in to comment.