Does updating one field will download the whole document from the database or just update local version?

為{幸葍}努か 提交于 2021-02-05 09:36:24

问题


For example the document contains the following structure:

{
  fieldA: number,
  fieldB: {
    subFieldA: string,
    subFieldB: string,
  }
}

... and is being listened with the onSnapshot method.

FirebaseDb
  .collection(`someCollection`).doc('documentAbove')
  .onSnapshot({ includeMetadataChanges: true }, (snapshot) => {
    // when the document being modified it becomes available at this stage
  })

My question is if when the document will be modified will the firestore download it once again?


回答1:


Yes, the document will be downloaded again in its entirety while that listener is active, and you will be charged for a read on that document for each change.



来源:https://stackoverflow.com/questions/60315286/does-updating-one-field-will-download-the-whole-document-from-the-database-or-ju

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!