Firebase Firestore模拟器如何工作? [英] How does Firebase Firestore emulator work?

查看:51
本文介绍了Firebase Firestore模拟器如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我一直在使用Firebase托管和功能模拟器.但是现在我要编写一个将基于Firestore触发器运行的函数,因此我正在研究Firestore模拟器进行开发.

So far I've been using Firebase Hosting and Functions emulators. But now I'm writting a function that will run based on a Firestore trigger, so I'm looking into the Firestore emulator for development.

但是它如何工作?它完全模仿Firestore吗?我能否读取保存在服务器上的当前Firestore数据?而且,如果我更新,创建或删除更改文档该怎么办,我是否还会在真实数据中进行更改?

But how does it work? Does it mimics Firestore completely? Will I be able to read my current Firestore data that it's saved on server? And what if I update, create or delete change documents, will I be really changing them in my real data as well?

我将使用:

firebase模拟器:开始-仅托管,功能,firestore

推荐答案

Firestore模拟器套件为您提供了足以在本地进行测试的功能.它不是云服务实际工作的完整副本.

The Firestore emulator suites gives you just enough functionality to test locally. It is not a full copy of what the cloud services actually do.

Firestore模拟器不允许您读写存储在服务器上的数据.您必须在本地填充数据库才能进行本地测试.

The Firestore emulator does not let you read and write data stored on the server. You have to populate the database locally in order to test locally.

如果您想使用云服务中托管的数据,请不要使用模拟器-只需照常访问项目即可.

If you want to use data hosted in the cloud service instead, then don't use the emulator - just access your project as normal.

这篇关于Firebase Firestore模拟器如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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