src/Filter/DbNameExtractor.php
public function filter($value)
    {
        // extract database
        $dbName = preg_match('~^mongodb://[^/]+/([^\?]+)~', $value, $match)
            ? $match[1]
            : $this->getDefaultDatabaseName();

        return $dbName;
    }
public function filter($value)
    {
        // extract database
        $dbName = preg_match('~^mongodb://[^/]+/([^\?]+)~', $value, $match)
            ? $match[1]
            : $this->getDefaultDatabaseName();

        return $dbName;
    }
public function filter ( $ value ) { // extract database $ dbName = preg_match ( '~^mongodb://[^/]+/([^\?]+)~' , $ value , $ match ) ? $ match [ 1 ] : $ this -> getDefaultDatabaseName ( ) ; return $ dbName ; }
Extracts the database name of a mongo db connection string.

If no database is specified in the connection string, the default
value {@link defaultDatabaseName} is returned.

@param  mixed $value

@return string
Extracts the database name of a mongo db connection string .