skip to Main Content

This is data at firebase

enter image description here

i want to get future data like this:

ref.where("startTime", ">", new Date()))

but it isn’t working

i try this:

ref.where("startTime.seconds", ">", Date.now() / 1000))

but it still doesn’t. i have no idea for this.

2

Answers


  1. Chosen as BEST ANSWER
    
    const startfulldate = firestore.Timestamp.fromDate(new Date());
    
    ref.where("startTime", ">", startfulldate)
    
    

    It's working. :)


  2. you can try with this

    ref().child("Users").orderByChild('startTime').startAt("2022-01-05").endAt("2029-01-10");
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search