- Mastering Firebase for Android Development
- Ashok Kumar S
- 55字
- 2021-06-18 18:49:14
RuleDataSnapshot and its methods
RuleDataSnapshot is accessible from data and newData predefined variables. RuleDataSnapshot offers a variety of methods to perform operations on. They are enlisted as follows:
![](https://epubservercos.yuewen.com/E46BFC/19470391708875606/epubprivate/OEBPS/Images/001.jpg?sign=1739475087-wncGztnRxwXTezyWi0QFTf6rHP9y4ufd-0-61d541bc7d87a9c8e7080c02ed20b0e7)
Consider the following code snippet that checks whether email fields exist or not, this will be very handy when you have huge datasets:
".write" : "data.child('Donor').child('Name').child('userid').child('email').exists()"