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;