Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Prisma · Const

gte

gte filters Prisma Client query results to values greater than or equal to a supplied threshold. It is used inside a field condition in a where clause.

How it works

Use gte inside a Prisma Client field filter to keep records whose value is greater than or equal to the supplied value. It works with orderable scalar values, including numbers and dates, and is typically placed within a model query's where object.

Syntax

{ field: { gte: value } }

Parameters

NameTypeDescription
xA value compatible with the filtered field, such as a number or DateThe comparison value x; records are retained when the selected field is greater than or equal to it.

Returns

A Prisma Client query result containing records whose selected field value is greater than or equal to the supplied comparison value.

Key points

  • gte includes records whose field value equals the threshold as well as records above it.
  • Use the operator beneath a numeric field in a where object to apply an inclusive minimum.
  • Date fields can use gte to select records from a specified point in time onward.

Example: Filter posts by a minimum likes value

const posts = await prisma.post.findMany({
  where: {
    likes: {
      gte: 9,
    },
  },
});

Returns posts whose likes value is at least 9.

When to use it

Inclusive numeric minimum

Select posts with at least a required number of likes.

Inclusive date boundary

Retrieve records created on or after a timestamp.

Range filtering

Build an inclusive range by pairing a lower bound with lte.

Interview questions

QWhat does Prisma Client's gte filter do?

gte means greater than or equal to. In a where filter, it keeps records whose field value meets or exceeds the comparison value.

Follow-up: How would you express an inclusive date range? Use gte for the lower bound and combine it with lte for the upper bound.

QHow is gte written in a Prisma where clause?

Place gte under the field being filtered, for example likes: { gte: 9 }. The comparison value must be compatible with that field's type.

Follow-up: What should be used for a strict lower bound? Use gt, which excludes records equal to the comparison value.

QWhat kinds of values can be compared with gte?

The operator can compare orderable values such as numeric fields and dates. A date filter supplies a JavaScript Date, allowing the query to select records on or after that timestamp.

Follow-up: How can the upper boundary also be inclusive? Add lte with the desired ending date in the same field filter.

  • gt
  • lte
  • lt
  • where
  • findMany

Source: Prisma Client API (Prisma ORM v7). Checked 2026-10-16.