php8.5
Home/ Manual/ mongodb / driver/ The MongoDB\Driver\WriteError class

The MongoDB\Driver\WriteError class

The MongoDB\Driver\WriteError class encapsulates information about a write error and may be returned as an array element from MongoDB\Driver\WriteResult::getWriteErrors.

Intro

The MongoDB\Driver\WriteError class encapsulates information about a write error and may be returned as an array element from MongoDB\Driver\WriteResult::getWriteErrors.

Class synopsis

class MongoDB\Driver\WriteError { }

Properties

message

The error message.

code

The error code.

index

The index of the write operation within the MongoDB\Driver\BulkWrite that caused the error.

info

Additional information for the error, or null if not available.

Changelog

VersionDescription
PECL mongodb 2.3.0Added public readonly properties.

Writeerror

In this section

Source: reference/mongodb/mongodb/driver/writeerror.xml · from the official PHP manual (php/doc-en)