public function setCredentials($username, $password)
    {
        $this->connectOptions['username'] = $username;
        $this->connectOptions['password'] = $password;
        
        return $this;
    }
public function setCredentials($username, $password)
    {
        $this->connectOptions['username'] = $username;
        $this->connectOptions['password'] = $password;
        
        return $this;
    }
public function setCredentials ( $ username , $ password ) { $ this -> connectOptions [ 'username' ] = $ username ; $ this -> connectOptions [ 'password' ] = $ password ; return $ this ; }
Set credentials to auth on db, specified in connect options or dsn.
If not specified - auth on admin db

@param string $username
@param string $password
@return \Sokil\Mongo\Client
Set credentials to auth on db specified in connect options or dsn . If not specified - auth on admin db