final class WriteResult (View source)

The MongoDB\Driver\WriteResult class encapsulates information about an executed MongoDB\Driver\BulkWrite and may be returned by MongoDB\Driver\Manager::executeBulkWrite().

Methods

__wakeup()

No description

int
getDeletedCount()

Returns the number of documents deleted. Throws an exception if the write was unacknowledged

int
getInsertedCount()

Returns the number of documents inserted (excluding upserts). Throws an exception if the write was unacknowledged

int
getMatchedCount()

Returns the number of documents selected for update. Throws an exception if the write was unacknowledged

int
getModifiedCount()

Returns the number of existing documents updated. Throws an exception if the write was unacknowledged

getServer()

Returns the server associated with this write result

int
getUpsertedCount()

Returns the number of documents inserted by an upsert. Throws an exception if the write was unacknowledged

array
getUpsertedIds()

Returns an array of identifiers for upserted documents

WriteConcernError|null
getWriteConcernError()

Returns any write concern error that occurred

array
getWriteErrors()

Returns any write errors that occurred

array
getErrorReplies()

No description

bool
isAcknowledged()

Returns whether the write was acknowledged

Details

final __wakeup()

No description

final int getDeletedCount()

Returns the number of documents deleted. Throws an exception if the write was unacknowledged

Return Value

int

final int getInsertedCount()

Returns the number of documents inserted (excluding upserts). Throws an exception if the write was unacknowledged

Return Value

int

final int getMatchedCount()

Returns the number of documents selected for update. Throws an exception if the write was unacknowledged

Return Value

int

final int getModifiedCount()

Returns the number of existing documents updated. Throws an exception if the write was unacknowledged

Return Value

int

final Server getServer()

Returns the server associated with this write result

Return Value

Server

final int getUpsertedCount()

Returns the number of documents inserted by an upsert. Throws an exception if the write was unacknowledged

Return Value

int

final array getUpsertedIds()

Returns an array of identifiers for upserted documents

Return Value

array

final WriteConcernError|null getWriteConcernError()

Returns any write concern error that occurred

Return Value

WriteConcernError|null

final array getWriteErrors()

Returns any write errors that occurred

Return Value

array

final array getErrorReplies()

Since: 1.16.0

No description

Return Value

array

final bool isAcknowledged()

Returns whether the write was acknowledged

Return Value

bool