How to delete firebase items that are “expired” or past the current date on Android Studio?

前端 未结 2 387
鱼传尺愫
鱼传尺愫 2021-01-23 20:58

Hello I am creating an Android app that lists local events happening around my campus. Each \"event\" has children for storing the title, image, category, info, and date. I was

2条回答
  •  滥情空心
    2021-01-23 21:20

    You can filter the fire base response on date itself

    ex:

    DatabaseReference mDatabaseReference =FirebaseDatabase.getInstance().getReference().child("table name");
    ref.orderByChild("date").startAt(startDate).endAt(endDate).on("child_added", function(snapshot){
    console.log("got the data!", snapshot);
    });
    

提交回复
热议问题