]> git.joonet.de Git - adminer.git/commitdiff
MongoDB driver: Add create_database methods.
authorDavid Sinquin <david.sinquin@gandi.net>
Tue, 27 Feb 2018 12:43:32 +0000 (13:43 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Mar 2018 10:48:02 +0000 (11:48 +0100)
MongoDB databases are created on the fly when some data is written in
the database, so this method does not need to do anything.

adminer/drivers/mongo.inc.php

index b466468388d0224ec0b362d2a065951ab259956f..b31cd098c97685976bba50c62a9c5c71641504d1 100644 (file)
@@ -171,6 +171,10 @@ if (isset($_GET["mongo"])) {
                        return array_fill_keys($connection->_db->getCollectionNames(true), 'table');
                }
 
+               function create_database($db, $collation) {
+                       return true;
+               }
+
                function drop_databases($databases) {
                        global $connection;
                        foreach ($databases as $db) {
@@ -436,6 +440,10 @@ if (isset($_GET["mongo"])) {
                        return $collections;
                }
 
+               function create_database($db, $collation) {
+                       return true;
+               }
+
                function drop_databases($databases) {
                        return false;
                }