0

So I'm using this method saveValue and only using the path parameter. The method is generating a unique key and data is stored while I'm inserting text in my input fields...

My question now is: How can I get to know what the new key is?

Regards, Peter

p3sn
  • 1,052
  • 1
  • 9
  • 17

1 Answers1

0

This is an old question but I just came across this issue. The answer is that the new path is saved to the path property of the firebase-document used to call saveValue.

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

...In some click handler....

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

          })
Spencer Easton
  • 5,642
  • 1
  • 16
  • 25