The Date Period Filter with Prisma is very simple.
目次
Filter by date period
Search above and below by specific date here.
const result = await prisma.post.findMany({
where: {
date_created: {
gte: new Date(
'2020-03-19T00:00:00+0200'
),
lte: new Date(
'2020-03-20T00:00:00+0200'
)
},
},
})
Translated as gt = greater than, lt = less than.
Translated as gte = greater than or equal to, lte = less than or equal to.
Filter conditions
The following is a summary of the most commonly used conditions for date filters.
スクロールできます
Operator | Filter |
---|---|
le | nより小さい |
lte | n以下 |
gt | nより大きい |
gte | n以上 |
equals | nと等しい |
Prisma Client API | Prisma Documentation
API reference documentation for Prisma Client.