# The MongoDB\Driver\WriteResult class

(mongodb >=1.0.0)

## Introduction

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

## Class synopsis

final MongoDB\Driver\WriteResult {
/* Methods */
final public getDeletedCount ( ) : int|null
final public getInsertedCount ( ) : int|null
final public getMatchedCount ( ) : int|null
final public getModifiedCount ( ) : int|null
final public getServer ( ) : MongoDB\Driver\Server
final public getUpsertedCount ( ) : int|null
final public getUpsertedIds ( ) : array
final public getWriteConcernError ( ) : MongoDB\Driver\WriteConcernError|null
final public getWriteErrors ( ) : array
final public isAcknowledged ( ) : bool
}

## Table of Contents

- MongoDB\Driver\WriteResult::getDeletedCount — Returns the number of documents deleted
- MongoDB\Driver\WriteResult::getInsertedCount — Returns the number of documents inserted (excluding upserts)
- MongoDB\Driver\WriteResult::getMatchedCount — Returns the number of documents selected for update
- MongoDB\Driver\WriteResult::getModifiedCount — Returns the number of existing documents updated
- MongoDB\Driver\WriteResult::getServer — Returns the server associated with this write result
- MongoDB\Driver\WriteResult::getUpsertedCount — Returns the number of documents inserted by an upsert
- MongoDB\Driver\WriteResult::getUpsertedIds — Returns an array of identifiers for upserted documents
- MongoDB\Driver\WriteResult::getWriteConcernError — Returns any write concern error that occurred
- MongoDB\Driver\WriteResult::getWriteErrors — Returns any write errors that occurred
- MongoDB\Driver\WriteResult::isAcknowledged — Returns whether the write was acknowledged