DocumentChange interface

DocumentChange表示與查詢相符的文件的變更。它包含受影響的文件以及發生的變更類型。

簽名:

export declare interface DocumentChange<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> 

特性

財產類型描述
文件查詢文件快照<應用程式模型類型,Db模型類型>受此變更影響的文件。
新索引數位緊接著此DocumentChange之後的結果集中已變更文件的索引(即假設已套用所有先前的DocumentChange物件和目前的DocumentChange物件)。 “已刪除”事件為 -1。
舊索引數位緊接在此DocumentChange之前的結果集中已更改文件的索引(即假設已套用所有先前的DocumentChange物件)。 “新增”事件為-1
類型文檔變更類型更改的類型(“新增”、“修改”或“刪除”)。

文檔更改.doc

受此變更影響的文件。

簽名:

readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>;

DocumentChange.newIndex

緊接著此DocumentChange之後的結果集中已變更文件的索引(即假設已套用所有先前的DocumentChange物件和目前的DocumentChange物件)。 “已刪除”事件為 -1。

簽名:

readonly newIndex: number;

文檔更改.oldIndex

緊接在此DocumentChange之前的結果集中已更改文件的索引(即假設已套用所有先前的DocumentChange物件)。 “新增”事件為-1

簽名:

readonly oldIndex: number;

DocumentChange.type

更改的類型(“新增”、“修改”或“刪除”)。

簽名:

readonly type: DocumentChangeType;