【Prisma】Where in the date period.

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
lenより小さい
lten以下
gtnより大きい
gten以上
equalsnと等しい
Filter conditions and operators
よかったらシェアしてね!
目次