Firebase Cloud Firestore中的部分脱机同步 [英] Partial offline sync in Firebase Cloud Firestore

查看:72
本文介绍了Firebase Cloud Firestore中的部分脱机同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Firebase Cloud Firestore中的一些集合离线同步到Android手机本地存储.

I want to offline sync some collections in Firebase Cloud Firestore to Android phone local store.

某些集合(例如日志数据)的大小太大,不需要同步到手机本地存储.

Some collections(E.g. log data) size are too large and are not needed to sync to phone local store.

任何人都可以为此提供指导吗?

Anyone can provide guidance for this?

推荐答案

您的客户端将仅保留其先前已阅读的那些文档.除非阅读了所有这些文档,否则它不会是一个完整的收藏,并且仅在合理的范围内.读取新文档后,旧文档将从缓存中逐出.

Your client will only persist those documents that it has previously read. It won't be an entire collection unless all those documents were read, and only up to a reasonable limit. Old documents will be evicted from the cache when new documents are read.

由于您尚未真正表达对脱机缓存可能发生的特殊问题,因此我假设您实际上没有观察到任何负面行为,并且您担心的是大型集合不会导致您的应用程序问题.

Since you haven't really voiced your specific concern about what might happen with offline caches, I'll assuming that you haven't actually observed any negative behavior, and you are just concerned that a large collection will not cause your app problems.

这篇关于Firebase Cloud Firestore中的部分脱机同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆