Firebase Android, checking if an object (with multiple children) exists

前端 未结 3 1765
野性不改
野性不改 2021-01-24 09:20

I am using a Firebase Database to store user’s reports. Each user is allowed to submit only 10 different reports.

In the example below we have a user named “Jasna Kulja

3条回答
  •  清歌不尽
    2021-01-24 09:52

    dataSnapshot.getChildrenCount() it will show you total number of children's.! All you have to do is make a Model class save your value in objects and while editing check if object has same data then don't update data and if its different then update data.!

提交回复
热议问题