Reuben
09/16/2021, 11:24 AMthorwebdev
09/16/2021, 3:06 PMconst { data, error } = await supabase
.from('cities')
.select('name, country_id')
.or('dateOut.lte.2021-01-31,dateOut.gte.2021-01-01,dateOut.is.null')
Reuben
09/16/2021, 4:23 PMdateOut
has a date within range 2021-01-01 - 2021-01-31 = list it
- If dateOut
is null = list it
I can do 2 queries for it but thought I'd combine them which seems difficult.
Query 1
.gte('dateOut', '2021-01-01')
.lte('dateOut', '2021-01-31')
Query 2
.is('dateOut', null)
Reuben
09/16/2021, 4:27 PMdateOut
prior to 2021-01-01 as it's actually earlier than the parameter 2021-01-31Reuben
09/16/2021, 4:28 PMReuben
09/16/2021, 4:32 PMconst { data, error } = await supabase
.from('cities')
.select('name, country_id')
.or('id.gt.20,and(name.eq.New Zealand,name.eq.France)')
where I played around with having
.or('dateOut.lte.2021-01-31,dateOut.is.null,and(dateOut.gte.2021-01-01)')
Reuben
09/16/2021, 4:40 PMdateOut: '2020-12-15',
Reuben
09/17/2021, 8:58 AM