1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 16:17:48 +02:00

MongoDB: Execute commands against the selected DB

This commit is contained in:
panji
2022-02-06 03:01:07 +07:00
committed by Jakub Vrana
parent 9261abc415
commit e676303a26
2 changed files with 3 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ if (isset($_GET["mongo"])) {
function connect($uri, $options) {
$class = 'MongoDB\Driver\Manager';
$this->_link = new $class($uri, $options);
$this->executeCommand('admin', array('ping' => 1));
$this->executeCommand($options["db"], array('ping' => 1));
}
function executeCommand($db, $command) {
@@ -399,7 +399,7 @@ if (isset($_GET["mongo"])) {
function get_databases($flush) {
global $connection;
$return = array();
foreach ($connection->executeCommand('admin', array('listDatabases' => 1)) as $dbs) {
foreach ($connection->executeCommand($connection->_db_name, array('listDatabases' => 1)) as $dbs) {
foreach ($dbs->databases as $db) {
$return[] = $db->name;
}

View File

@@ -1,6 +1,7 @@
Adminer 4.16.0-dev:
PostgreSQL: Preserve whitespace in EXPLAIN (bug #827)
Oracle: Include tables granted by other user
MongoDB: Execute commands against the selected DB
Adminer 4.15.0:
Escape unknown field in select