|
MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrorsReturns any write errors 説明
final public array MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors()
パラメータこの関数にはパラメータはありません。 戻り値An array of any MongoDB\Driver\WriteErrors that occurred during the execution of individual write operations. Array keys will correspond to the index of the write operation from MongoDB\Driver\BulkWriteCommand. This map will contain at most one entry if the bulk write was ordered. 例例1 MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors example
上の例の出力は、 たとえば以下のようになります。 array(2) { [2]=> object(MongoDB\Driver\WriteError)#5 (4) { ["message"]=> string(78) "E11000 duplicate key error collection: db.coll index: _id_ dup key: { _id: 1 }" ["code"]=> int(11000) ["index"]=> int(2) ["info"]=> object(stdClass)#6 (0) { } } [3]=> object(MongoDB\Driver\WriteError)#7 (4) { ["message"]=> string(78) "E11000 duplicate key error collection: db.coll index: _id_ dup key: { _id: 1 }" ["code"]=> int(11000) ["index"]=> int(3) ["info"]=> object(stdClass)#8 (0) { } } } 参考
|