danecando
danecando
DTDrizzle Team
Created by danecando on 10/31/2023 in #help
Issue filtering by date equality
I'm running into an issue where I don't get any results for a value with matches in the db. Example query using date string directly from db gives me two results:
SELECT id, starting_at
FROM public.meeting_events
WHERE meeting_events.starting_at = '2023-11-01 23:00:40.145'
ORDER BY meeting_events.starting_at, id ASC
LIMIT 30;
SELECT id, starting_at
FROM public.meeting_events
WHERE meeting_events.starting_at = '2023-11-01 23:00:40.145'
ORDER BY meeting_events.starting_at, id ASC
LIMIT 30;
If I send this value through new Date('xxx').toISOString() I get back: 2023-11-02T03:00:40.145Z Same query with this value returns 0 results
SELECT id, starting_at
FROM public.meeting_events
WHERE meeting_events.starting_at = '2023-11-02T03:00:40.145Z'
ORDER BY meeting_events.starting_at, id ASC
LIMIT 30;
SELECT id, starting_at
FROM public.meeting_events
WHERE meeting_events.starting_at = '2023-11-02T03:00:40.145Z'
ORDER BY meeting_events.starting_at, id ASC
LIMIT 30;
I'm seeing the same behavior when trying to equality filter this value using drizzle IE: where: eq(meetingEvents.startingAt, decodedCursor ? new Date(decodedCursor.startingAt) : afterDate), Not sure if this is a known issue people have run into or if I'm just doing something wrong. Like maybe I need to use dates in string mode?
13 replies