提供Firestore数据库的初始快照 [英] Providing an Initial Snapshot of a Firestore database

查看:45
本文介绍了提供Firestore数据库的初始快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑将Android数据迁移到Firestore.我们有一个主要是只读的数据库(用户只会读一次,但是工作人员每天会推送几次更新).目前,我们不考虑Firebase存储.

We are considering migrating our Android data to Firestore. We have a mostly read-only database (Users will only ever read, but staff will push updates a couple of times daily). For now we are not considering Firebase Storage.

对我们来说,最大的问题是数据库相当大,我们瞄准的是数据合同较差的市场-我们并不希望每个人都在首次启动时就获取完整的数据库(我知道你可以进行部分请求,但需要全部数据)

The biggest issue for us is that with the database being fairly large and us targeting markets with poor data contracts - we don't wan't everybody to fetch the full database on first launch (I'm aware you can do partial requests, but the full data would be required)

我们想通过在每个发行版中捆绑一个默认数据库来解决此问题(我们目前正在这样做),然后该设备将与Firestore同步并下载更新的版本.

We wanted to solve this by bundling a default database with each release (we currently do this), the device would then sync with Firestore and download the newer mutations.

这有可能吗?我们希望将Firestore对象与文档的捆绑副本或序列化快照连接起来?

Is this possible at all? We are hoping to connect the Firestore objects with either bundled copies of the documents or with a serialized snapshot?

此处的目的是使Firestore SDK将快照视为完整的文档集-就像您早在几个小时前在设备上运行查询并保留了侦听器一样.因此,听众将收到增量.

推荐答案

Firestore无法提供将SDK可以查询的一些默认数据绑定到您的应用程序的方法.Firebase是一个由云托管的数据库,这意味着所有数据都必须在云中"才能被查询(或必须事先在本地查询和缓存,可以在脱机时读取).

Firestore doesn't provide a way to bundle into your app some default data that can be queried with the SDK. Firebase is a cloud-hosted database, which means that all data must live "in the cloud" in order to be queried (or must have been previously queried and cached locally, which can be read while offline).

但是,您始终可以提交功能请求.

这篇关于提供Firestore数据库的初始快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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