Trying to get rows based on timeframes, so last 24 hours, last 7 days, last 30 days, last 1 year, etc.
Last day being calculated like this
let lastDay = Date.now() - (24 * 60 * 60 * 1000)
lastDay = new Date(lastDay).toISOString()
when using .findMany, etc, in the where would the AND be something like this?
AND: {
date: {
gte: lastDay
}
}
So find rows of date that is greater than or equal to the last 24 hours?