diff --git a/src/Query.php b/src/Query.php index f2274c4d2..006adfdc2 100644 --- a/src/Query.php +++ b/src/Query.php @@ -505,17 +505,14 @@ public function exists($db = null) * https://blog.serverdensity.com/checking-if-a-document-exists-mongodb-slow-findone-vs-find/ */ #save last options - $tmpOrderBy = $this->orderBy; $tmpLimit = $this->limit; $tmpOffset = $this->offset; $tmpSelect = $this->select; - $this->orderBy = []; $this->limit = 1; $this->offset = null; $this->select = ['_id']; $cursor = $this->buildCursor($db); #return last options - $this->orderBy = $tmpOrderBy; $this->limit = $tmpLimit; $this->offset = $tmpOffset; $this->select = $tmpSelect;