Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

DocumentChange

A DocumentChange represents a change to the documents matching a query. It contains the document affected and the type of change that occurred.

interface DocumentChange <AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> {
readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>;
readonly newIndex: number;
readonly oldIndex: number;
readonly type: DocumentChangeType;
}

§Type Parameters

§
AppModelType = DocumentData
[src]
§
DbModelType extends DocumentData = DocumentData
[src]

§Properties

§
readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>
[src]

The document affected by this change.

§
readonly newIndex: number
[src]

The index of the changed document in the result set immediately after this DocumentChange (i.e. supposing that all prior DocumentChange objects and the current DocumentChange object have been applied). Is -1 for 'removed' events.

§
readonly oldIndex: number
[src]

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). Is -1 for 'added' events.

§

The type of change ('added', 'modified', or 'removed').