I’m storing user birthdays using the Date
function. I need to be able to retrieve users who were born on a specific date (day and month only, i.e. disregarding the year).
Example of a user:
{
"ref": Ref(Collection("Users"), "370155148899516621"),
"ts": 1690378914440000,
"data": {
"email": "email@example.com",
"date": Date("2001-07-26")
}
}
The above user should match an index search for Date("2023-07-26")
.
I know I can probably use the Equals
function to compare the desired date and user dates based on the %tm-%td
format, however I’m struggling to compose the query.
Can anyone point me in the right direction? Thank you!