public function getConnectionString() {
		$connection = new Url('mongodb');
		$connection->setPath($this->dbname);
		
		if ($this->username !== null) {
			$connection->setUsername($this->username);
			
			if ($this->password !== null) {
				$connection->setPassword($this->password);
			}
		}
		
		if (empty($this->hosts)) {
			$connection->setHost($this->defaultHost)
			           ->setPort($this->defaultPort);
			
			return $connection->assemble();
		}
		
		$hosts = array_map([$this, 'assembleHost'], $this->hosts);
		$connection->setHost(implode(',', $hosts));
		
		return $connection->assemble();
	}
public function getConnectionString() {
		$connection = new Url('mongodb');
		$connection->setPath($this->dbname);
		
		if ($this->username !== null) {
			$connection->setUsername($this->username);
			
			if ($this->password !== null) {
				$connection->setPassword($this->password);
			}
		}
		
		if (empty($this->hosts)) {
			$connection->setHost($this->defaultHost)
			           ->setPort($this->defaultPort);
			
			return $connection->assemble();
		}
		
		$hosts = array_map([$this, 'assembleHost'], $this->hosts);
		$connection->setHost(implode(',', $hosts));
		
		return $connection->assemble();
	}
public function getConnectionString ( ) { $ connection = new Url ( 'mongodb' ) ; $ connection -> setPath ( $ this -> dbname ) ; if ( $ this -> username !== null ) { $ connection -> setUsername ( $ this -> username ) ; if ( $ this -> password !== null ) { $ connection -> setPassword ( $ this -> password ) ; } } if ( empty ( $ this -> hosts ) ) { $ connection -> setHost ( $ this -> defaultHost ) -> setPort ( $ this -> defaultPort ) ; return $ connection -> assemble ( ) ; } $ hosts = array_map ( [ $ this , 'assembleHost' ] , $ this -> hosts ) ; $ connection -> setHost ( implode ( ',' , $ hosts ) ) ; return $ connection -> assemble ( ) ; }
Get MongoClient connection string

@return string
Get MongoClient connection string