Checking if a particular value exists in the Firebase database

前端 未结 6 1901
孤城傲影
孤城傲影 2020-11-22 07:04

I am making an Android application using Firebase realtime database. When a new user registers on my app, that user\'s data is saved in the Firebase database. <

6条回答
  •  粉色の甜心
    2020-11-22 07:15

    Instead of checking for the exists of the reference you can use orderBy query to check whether username exists already

    orderByChild('username').equalTo(username) query would return data if some data already exists else it will return null.

提交回复
热议问题