How to check existed data in firebase?

前端 未结 2 705
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 10:09

I am using firebase database, but I am newbie with it. I am following this tutorial,

Now, my question is how can I check the email if it is already exist in the data

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 10:22

    Inside ValueEventListener() check email address is exist or not Try this

    if(!dataSnapshot.child("users").child("email").exist)
    

    then insert new value

提交回复
热议问题