如何从Angular防火墙中获取UID没有快照的文档

时间:2018-02-26 10:03:30

标签: firebase angularfire angularfire2 angularfire5

假设我有一个名为Countries的集合,而文档如下所示

{
  name: "Pakistan"
  //other field removed to focus on problem only
}

以及具有上述国家/地区字段引用的文档的集合名称Cities类似于

{
  name: "Karachi",
  //other field removed to focus on problem only
  city: "3FbRFiWB4DmfdcxDdei3" //reference of country document
}

现在我将国家和城市显示为用户选择国家/地区的订购下拉菜单,然后下一个下拉列表显示已过滤的城市

let countryRef = this.angularFireStore.collection('Countries', ref => ref);
let countries = countryRef.valueChanges();

和html绑定看起来像

let country of country | async"

以下是用户的任何更改或选择事件的实际问题我必须根据所选国家/地区将国家ID传递给已填充的已过滤城市,但我无法在国家/地区获取ID。如何实现这一目标 任何帮助将不胜感激。

注意:我知道我可以通过获取快照更改来获取id和其他元数据但是响应很晚我只想在引用绑定中使用id字段来编辑或更新文档。

0 个答案:

没有答案
相关问题