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

Prisma · Pipe

skip

Prisma.skip is a Prisma-provided symbol that explicitly omits a field from a Prisma Client query. Use it instead of undefined when an optional input should not be included.

How it works

Prisma.skip is a Prisma-provided symbol for omitting a field from a Prisma Client query. Use it instead of undefined when an optional value should leave that field out of the generated query.

Syntax

Prisma.skip

Key points

  • Use Prisma.skip when a field should be left out of a Prisma Client query.
  • Prisma.skip is supplied by Prisma rather than being a JavaScript language feature.
  • Assigning Prisma.skip causes Prisma Client to exclude that field from the generated query.
  • Nullish coalescing provides a concise way to convert an absent optional value into an omitted field.

Common mistakes

  • Do not use undefined to intentionally omit a field; use Prisma.skip instead.
  • An undefined filter value means the filter is not defined, which can change the scope of a query.

Example: Omit an optional field

import { PrismaClient, Prisma } from "@prisma/client";

const prisma = new PrismaClient();

const optionalEmail: string | undefined = undefined;

await prisma.user.create({
  data: {
    name: "Alice",
    email: optionalEmail ?? Prisma.skip,
  },
});

Uses Prisma.skip to omit email when the optional value is undefined.

When to use it

Conditional writes

A create or update input has an optional property that should be excluded when absent.

Dynamic query construction

A query builder assembles fields from optional application inputs.

Conditional filtering

Optional filters must be included only when callers provide values.

Interview questions

QWhat is Prisma.skip used for?

Prisma.skip is a symbol supplied by Prisma for omitting a field from a Prisma Client query. It is the explicit replacement for using undefined when an optional value should not be sent.

Follow-up: What expression is useful when a value may be undefined? Use optionalValue ?? Prisma.skip so defined values are retained and undefined values omit the field.

QHow does Prisma.skip differ from undefined?

With Prisma.skip, the field is omitted from the query rather than being sent with an undefined value. This makes the omission intentional and explicit.

Follow-up: How does undefined behave in a filter? It effectively means that no filter was defined for that field, so the query does not constrain that column by that key.

QHow should Prisma.skip be used with optional input?

A common pattern is to combine a possibly undefined value with the nullish-coalescing operator: optionalValue ?? Prisma.skip. The actual value is used when present; otherwise Prisma.skip omits the field.

Follow-up: Why should this matter for filters? An omitted filter can broaden the query, so optional filtering should be handled deliberately rather than relying on undefined.

  • undefined
  • null
  • Prisma Client
  • nullish coalescing operator

Source: Null and undefined. Checked 2026-10-16.