【发布时间】:2020-08-01 09:32:42
【问题描述】:
我正在尝试将本地环境中的数据(在我机器上的 iis 上运行)写入我的 Google Firestore 模拟器。代码运行,不会抛出错误,但数据似乎没有被写入 Firestore 模拟器。
使用 firebase CLI 工具 v8.6.0 Google.Cloud.Firestore v2.1.0
string project = ConfigurationManager.AppSettings["firestore_projectid"];
Environment.SetEnvironmentVariable("FIRESTORE_EMULATOR_HOST", "localhost:8080");
FirestoreDb db = new FirestoreDbBuilder
{
ProjectId = project,
EmulatorDetection = Google.Api.Gax.EmulatorDetection.EmulatorOnly
}.Build();
var dto = await GetLiveStreamDto();
DocumentReference docRef = db
.Collection("Events")
.Document("123456789")
await docRef.SetAsync(dto, SetOptions.MergeAll);
【问题讨论】:
标签: c# .net firebase google-cloud-firestore emulation