Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
Firestore query by date

I am tring to query to a Firestore database to a collection and filter by date. I have a Timestamp field (dateStart) and i need to get the results have date today , i don't care about time ,i tried to use this but it works only have same time

My document : 20 septembre 2021 at 01:30:00 UTC+1

refWallet
  .where("dateStart", "==", new Date("2021,09,20"))
  .get()
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You will need a range query with start and end points to cover the intended time. In Firestore, timestamp types are always considered a single point in time and do not have date and time components available. It's the same for Date objects in JavaScript.

refWallet
  .where("dateStart", ">=", startDate)
  .where("dateStart", "<", endDate)
  .get()

If this is not what you want, then you probably shouldn't use a timestamp type field and instead use a string that will give you an exact match. For example, you could store dates as strings formatted YYYYMMDD in order to query for exact dates without ranges.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!