Check If A Value Exits In Firebase
This is my Customer's Node customers { '-KXKCee0yVJE1z1gCQcV' : { 'cust_id' : '-KXKCee0yVJE1z1gCQcV', 'email' : “xxx@xxx.com', 'food_pref' : 'nonveg', 'name' : “Jind', 'notes
Solution 1:
You should use addListenerForSingleValueEvent
.
The ChildEventListener
will be invoked only if the child exists. If it doesn't, nothing will happen.
The ValueEventListener
will always be invoked and you can call the snapshot's exists()
method to check for existence.
Post a Comment for "Check If A Value Exits In Firebase"