GoLang MongoDB::forceError

request it (214)
GoLang replacement for PHP's MongoDB::forceError [edit | history]

Do you know a GoLang replacement for PHP's MongoDB::forceError? Write it!

PHP MongoDB::forceError

PHP original manual for MongoDB::forceError [ show | php.net ]


(PECL mongo >=0.9.5)

MongoDB::forceErrorCreates a database error


public bool MongoDB::forceError ( void )

This method is not very useful for normal MongoDB use. It forces a database error to occur. This means that MongoDB::lastError() will return a generic database error after running this command.

This command is identical to running:


public function forceError() {
$this->command(array('forceerror' => 1));



This function has no parameters.

Return Values

Returns the database response.


Version Description
1.2.11 Emits E_DEPRECATED when used.