【问题标题】:How to get the generated key of the saveValue method in Polymerfire?Polymerfire中如何获取saveValue方法生成的key?
【发布时间】:2017-08-08 16:16:42
【问题描述】:

所以我使用这个method saveValue 并且只使用路径参数。该方法正在生成唯一键并在我在输入字段中插入文本时存储数据......

我现在的问题是:我怎样才能知道新密钥是什么?

问候,彼得

【问题讨论】:

    标签: firebase polymer-1.0 polymerfire


    【解决方案1】:

    这是一个老问题,但我刚刚遇到了这个问题。答案是新路径被保存到用于调用 saveValue 的 firebase-document 的 path 属性中。

    <firebase-document id="NewUserSync"></firebase-document>
    

    ...在某些点击处理程序中...

    this.$.NewUserSync.path = null;
    this.$.NewUserSync.data = OrgData;
    this.$.NewUserSync.saveValue(`/Customer_Orgs/`).then(resp => {
                console.log(this.$.NewUserSync.path);
                // /Customer_Orgs/-LH_pEzgWJpv3mpYYTuA     
    
              })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-25
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 2018-01-28
      • 1970-01-01
      相关资源
      最近更新 更多