DocumentChange
は、クエリに一致するドキュメントへの変更を表します。これには、影響を受けるドキュメントと発生した変更の種類が含まれます。
サイン:
export declare interface DocumentChange<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>
プロパティ
財産 | タイプ | 説明 |
---|---|---|
博士 | クエリドキュメントスナップショット<AppModelType、DbModelType> | この変更の影響を受けるドキュメント。 |
新しいインデックス | 番号 | このDocumentChange の直後の結果セット内の変更されたドキュメントのインデックス (つまり、以前のすべてのDocumentChange オブジェクトと現在のDocumentChange オブジェクトが適用されていると仮定します)。 「削除された」イベントの場合は -1 です。 |
古いインデックス | 番号 | このDocumentChange の直前に結果セット内で変更されたドキュメントのインデックス (つまり、以前のすべてのDocumentChange オブジェクトが適用されていると仮定します)。 「追加された」イベントの場合は-1 です。 |
タイプ | DocumentChangeType | 変更のタイプ (「追加」、「変更」、または「削除」)。 |
DocumentChange.doc
この変更の影響を受けるドキュメント。
サイン:
readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>;
DocumentChange.newIndex
このDocumentChange
の直後の結果セット内の変更されたドキュメントのインデックス (つまり、以前のすべてのDocumentChange
オブジェクトと現在のDocumentChange
オブジェクトが適用されていると仮定します)。 「削除された」イベントの場合は -1 です。
サイン:
readonly newIndex: number;
DocumentChange.oldIndex
このDocumentChange
の直前に結果セット内で変更されたドキュメントのインデックス (つまり、以前のすべてのDocumentChange
オブジェクトが適用されていると仮定します)。 「追加された」イベントの場合は-1
です。
サイン:
readonly oldIndex: number;
DocumentChange.type
変更のタイプ (「追加」、「変更」、または「削除」)。
サイン:
readonly type: DocumentChangeType;