From a45012fbba42bc275d68c6ebf93dd3ec6cff7d2b Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Wed, 22 Mar 2017 14:43:54 +0200 Subject: [PATCH] Do not perform update when no changes found. --- src/Storage.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Storage.php b/src/Storage.php index 590a04f..3881e51 100644 --- a/src/Storage.php +++ b/src/Storage.php @@ -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()) {