Firestore — Get only the changed documents in a large synced collection

后端 未结 1 1574
遇见更好的自我
遇见更好的自我 2020-12-22 05:06

I\'ve read all of the questions below, and cannot find anything in the docs to describe how to sync a collection and receive only changed documents from a collectio

相关标签:
1条回答
  • 2020-12-22 05:35

    Firestore queries don't have a notion of querying "only things that have changed". You will need to create that notion on your own. The usual way to do this is by recording a timestamp in each document with the time it was last updated, then using that field in a range filter to get only documents updated since the latest update was received. You will need to track that latest update timestamp in the client. One possibility is to use the greatest timestamp seen in any document to date.

    0 讨论(0)
提交回复
热议问题