PHP » GoLang |
login |
register |
about
|
GoLang MongoDB::lastError
request it (656)
GoLang replacement for PHP's MongoDB::lastError
[edit | history]
MongoDB::lastError(PECL mongo >=0.9.5) MongoDB::lastError — Check if there was an error on the most recent db operation performed Description
public array MongoDB::lastError
( void
)
This method is equivalent to:
<?phpParametersThis function has no parameters. Return ValuesReturns the error, if there was one. ExamplesExample #1 MongoDB::lastError()
<?phpThe above example will output something similar to:
array(3) {
["err"]=>
NULL
["n"]=>
int(0)
["ok"]=>
float(1)
}
Example #2 MongoDB::lastError() duplicate key example
<?phpThe above example will output something similar to:
array(3) {
["err"]=>
string(64) "E11000 duplicate key errorindex: foo.foo.$_id_ dup key: { : 1 }"
["n"]=>
int(0)
["ok"]=>
float(1)
}
|
more
Most requested
more
Last requests
|