]> git.joonet.de Git - adminer.git/commitdiff
MongoDB: Fix executeQuery
authorJakub Vrana <jakub@vrana.cz>
Tue, 9 Feb 2021 15:32:38 +0000 (16:32 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 9 Feb 2021 15:32:38 +0000 (16:32 +0100)
adminer/drivers/mongo.inc.php

index 74163daa468c94aa3c1e5f7b534aaad0ee0ccf2a..7b6453a342c8348f7f5cb502a2984123f90aa863 100644 (file)
@@ -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);
                        }