|
MongoDB::lastErrorCheck if there was an error on the most recent db operation performed Beschreibung
public array MongoDB::lastError
( void
)
This method is equivalent to:
<?phpParameter-ListeDiese Funktion hat keine Parameter. RückgabewerteReturns the error, if there was one. BeispieleBeispiel #1 MongoDB::lastError
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
array(3) {
["err"]=>
NULL
["n"]=>
int(0)
["ok"]=>
float(1)
}
Beispiel #2 MongoDB::lastError duplicate key example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
array(3) {
["err"]=>
string(64) "E11000 duplicate key errorindex: foo.foo.$_id_ dup key: { : 1 }"
["n"]=>
int(0)
["ok"]=>
float(1)
}
|