PHP » GoLang |
login |
register |
about
|
GoLang MongoDB::lastError
request it (402)
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:
<?php ParametersThis function has no parameters. Return ValuesReturns the error, if there was one. ExamplesExample #1 MongoDB::lastError()
<?php The above example will output something similar to: array(3) { ["err"]=> NULL ["n"]=> int(0) ["ok"]=> float(1) } Example #2 MongoDB::lastError() duplicate key example
<?php The 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
Recently updated
more
Most requested
more
Last requests
|