MongoLite\Database::getCollectionNames PHP Method

getCollectionNames() public method

Get all collection names in the database
public getCollectionNames ( ) : array
return array
    public function getCollectionNames()
    {
        $stmt = $this->connection->query("SELECT name FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence';");
        $tables = $stmt->fetchAll(\PDO::FETCH_ASSOC);
        $names = array();
        foreach ($tables as $table) {
            $names[] = $table["name"];
        }
        return $names;
    }