yii\mongodb\Connection::close PHP Méthode

close() public méthode

It does nothing if the connection is already closed.
public close ( )
    public function close()
    {
        if ($this->manager !== null) {
            Yii::trace('Closing MongoDB connection: ' . $this->dsn, __METHOD__);
            $this->manager = null;
            foreach ($this->_databases as $database) {
                $database->clearCollections();
            }
            $this->_databases = [];
        }
    }