From a4ae20e12089cf2edf6848b5a6ba00ff8e12aabb Mon Sep 17 00:00:00 2001 From: Ziaratban Date: Sat, 11 May 2024 08:36:12 +0330 Subject: [PATCH] support sort in exists method --- src/Query.php | 3 --- 1 file changed, 3 deletions(-) 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;