How to get only the new items added to firebase?

孤者浪人 提交于 2020-01-04 15:25:24

问题


I'm developing an Android application and it's using the firebase to fetch its data. The onChildAdded() method in Firebase triggers off for all the children. Is there any hack to just get the newly added child alone?

PS: Each of the child has a date with it.


回答1:


You could save the last date you updated and then use it as reference to filter what is new.



来源:https://stackoverflow.com/questions/36648907/how-to-get-only-the-new-items-added-to-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!