Only retrieve changed document field

后端 未结 1 1358
无人及你
无人及你 2021-01-28 08:05

I found out that listening to document changes will always download the full document over and over.

I have a problem with this in the following scenario: The

相关标签:
1条回答
  • 2021-01-28 08:36

    Firestore always returns complete documents. There is no way to get it to return a subset of the fields in a document, neither by explicitly asking for those fields (akin to a SELECT FIELD1, FIELD2 statement), nor implicitly asking (as you do by wanting only modified fields).

    If you want to limit bandwidth usage for frequently changing documents with a large payload, your workaround of putting the more static part of the data in a separate document is valid.

    Also see:

    • How to access a specific field from Cloud FireStore Firebase in Swift
    • Firestore - get specific fields from document
    • How to allow only particular fields of a firestore document to be accessed publicly
    0 讨论(0)
提交回复
热议问题