Skip to content
Advertisement

How to get the key of a pushed value

In Firebase Realtime Database on Android, I want to retrieve this id “-Mb1sSv-FCNr9ElxZIwN”.

JavaScript

enter image description here

Advertisement

Answer

It looks to me that KAsr ... dhz1 is the user ID that comes from the authentication process. If so, that UID should also be added to your reference. So to be able to get this id “-Mb1sSv-FCNr9ElxZIwN”, please change the following reference:

JavaScript

To:

JavaScript

Meaning that:

JavaScript

Will set the above key to the “DB” object.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement