From c24a6a6aef25ed1fa66c09db8cffc376da30cdd3 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 9 Feb 2021 16:32:38 +0100 Subject: [PATCH] MongoDB: Fix executeQuery --- adminer/drivers/mongo.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adminer/drivers/mongo.inc.php b/adminer/drivers/mongo.inc.php index 74163daa..7b6453a3 100644 --- a/adminer/drivers/mongo.inc.php +++ b/adminer/drivers/mongo.inc.php @@ -27,10 +27,10 @@ if (isset($_GET["mongo"])) { } } - function executeQuery($db, $command) { + function executeQuery($namespace, $where, $command) { $class = 'MongoDB\Driver\Query'; try { - return $this->_link->executeQuery($db, new $class($command)); + return $this->_link->executeQuery($namespace, new $class($where, $command)); } catch (Exception $e) { $this->error = $e->getMessage(); return array(); @@ -136,7 +136,7 @@ if (isset($_GET["mongo"])) { } $limit = min(200, max(1, (int) $limit)); $skip = $page * $limit; - $results = $connection->executeQuery("$connection->_db_name.$table", array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort)); + $results = $connection->executeQuery("$connection->_db_name.$table", $where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort)); return new Min_Result($results); }