PHP » GoLang |
login |
register |
about
|
GoLang MongoDB\Driver\WriteResult::getWriteErrors
request it (344)
GoLang replacement for PHP's MongoDB\Driver\WriteResult::getWriteErrors
[edit | history]
PHP MongoDB\Driver\WriteResult::getWriteErrorsPHP original manual for MongoDB\Driver\WriteResult::getWriteErrors [ show | php.net ]MongoDB\Driver\WriteResult::getWriteErrors(mongodb >=1.0.0) MongoDB\Driver\WriteResult::getWriteErrors — Returns any write errors that occurred Description
final public array MongoDB\Driver\WriteResult::getWriteErrors
( void
)
ParametersThis function has no parameters. Return ValuesReturns an array of MongoDB\Driver\WriteError objects for any write errors encountered during the write operation. The array will be empty if no write errors occurred. Errors/Exceptions
ExamplesExample #1 MongoDB\Driver\WriteResult::getWriteErrors() with a single error
<?php The above example will output something similar to: array(1) { [0]=> object(MongoDB\Driver\WriteError)#5 (4) { ["message"]=> string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 2 }" ["code"]=> int(11000) ["index"]=> int(2) ["info"]=> NULL } } Example #2 MongoDB\Driver\WriteResult::getWriteErrors() with multiple errors
<?php The above example will output something similar to: array(2) { [0]=> object(MongoDB\Driver\WriteError)#5 (4) { ["message"]=> string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 2 }" ["code"]=> int(11000) ["index"]=> int(2) ["info"]=> NULL } [1]=> object(MongoDB\Driver\WriteError)#6 (4) { ["message"]=> string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 4 }" ["code"]=> int(11000) ["index"]=> int(5) ["info"]=> NULL } } See Also |
more
Recently updated
more
Most requested
more
Last requests
|