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;