4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.1

    public sealed class DocumentChange : IEquatable<DocumentChange>

Reference documentation and code samples for the Firestore API class DocumentChange.

A DocumentChange represents a change to the documents matching a query. It contains the document
affected and a the type of change that occurred (added, modifed, or removed).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> DocumentChange

## Implements

[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[DocumentChange](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentChange)

## Inherited Members

[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)

## Assembly

Google.Cloud.Firestore.dll

## Properties

### ChangeType

    public DocumentChange.Type ChangeType { get; }

The type of change that was observed.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentChangehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentChange.Type` |   |

### Document

    public DocumentSnapshot Document { get; }

The newly added or modified document, or the document that was deleted.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentSnapshot` |   |

### NewIndex

    public int? NewIndex { get; }

The index of the changed document in the result set immediately after this DocumentChange
(i.e. supposing that all prior DocumentChange objects and this one have been applied),
null if the change type is [Removed](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentChange.Type#Google_Cloud_Firestore_DocumentChange_Type_Removed). The index will never be negative.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### OldIndex

    public int? OldIndex { get; }

The index of the changed document in the result set immediately prior to this DocumentChange
(i.e. supposing that all prior DocumentChange objects have been applied), or null
if the change type is [Added](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.DocumentChange.Type#Google_Cloud_Firestore_DocumentChange_Type_Added). The index will never be negative.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

## Methods

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)