DocumentChange

classDocumentChange


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

Subclassing Note: Cloud Firestore classes are not meant to be subclassed except for use in test mocks. Subclassing is not supported in production code and new SDK releases may break code that does so.

Summary

Nested types

An enumeration of snapshot diff types.

Public functions

Boolean
equals(object: Any?)
Int

Public properties

QueryDocumentSnapshot!
Int

The index in the new snapshot, after processing all previous changes.

Int

The index in the old snapshot, after processing all previous changes.

DocumentChange.Type!

Public functions

equals

fun equals(object: Any?): Boolean

hashCode

fun hashCode(): Int

Public properties

newIndex

val newIndexInt

The index in the new snapshot, after processing all previous changes.

oldIndex

val oldIndexInt

The index in the old snapshot, after processing all previous changes.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.