With firestore, is it possible to configure offline persistence to set 'off' in a specific document?

后端 未结 2 997
离开以前
离开以前 2021-01-16 22:09

I need to set off the persistence in a certain document in Firestore; but all other documents should work with default configuration like this implementation. I have impleme

相关标签:
2条回答
  • 2021-01-16 22:21

    The way offline persistence works is by synchronizing the current state of each document written while offline. It doesn't synchronize the entire history of all the writes. The history of writes is irrelevant - what matters is only the current values in the document. Therefore, enabling persistence is not as expensive as you might be expecting.

    As Frank said, you can't selectively choose to synchronize only some documents. It's either entirely off or on. Personally, I don't think you have a compelling case to disable it.

    0 讨论(0)
  • 2021-01-16 22:24

    Disk persistence can only be enabled for the entire Firestore client, before performing any other operations. It cannot be enabled/disabled for specific collections, queries or documents.

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