Labsco
prisma logo

prisma-client-api-filters

✓ Official8

by prisma · part of prisma/cursor-plugin

Filter Conditions and Operators

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the prisma/cursor-plugin package — works on its own, and pairs well with its siblings.

Filter Conditions and Operators

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by prisma

Filter Conditions and Operators npx skills add https://github.com/prisma/cursor-plugin --skill prisma-client-api-filters Download ZIPGitHub8

Filter Conditions and Operators

Filter operators for the where clause.

Equality

Copy & paste — that's it
// Exact match (implicit)
where: { email: '[email protected]' }

// Explicit equals
where: { email: { equals: '[email protected]' } }

// Not equal
where: { email: { not: '[email protected]' } }

Comparison

Copy & paste — that's it
// Greater than
where: { age: { gt: 18 } }

// Greater than or equal
where: { age: { gte: 18 } }

// Less than
where: { age: { lt: 65 } }

// Less than or equal
where: { age: { lte: 65 } }

// Combined
where: { age: { gte: 18, lte: 65 } }

Lists

Copy & paste — that's it
// In array
where: { role: { in: ['ADMIN', 'MODERATOR'] } }

// Not in array
where: { role: { notIn: ['GUEST', 'BANNED'] } }

String Filters

Copy & paste — that's it
// Contains
where: { email: { contains: 'prisma' } }

// Starts with
where: { email: { startsWith: 'alice' } }

// Ends with
where: { email: { endsWith: '@prisma.io' } }

// Case-insensitive (default for some databases)
where: { 
 email: { 
 contains: 'PRISMA',
 mode: 'insensitive' 
 } 
}

Null Checks

Copy & paste — that's it
// Is null
where: { deletedAt: null }

// Is not null
where: { deletedAt: { not: null } }

// Using isSet (for optional fields)
where: { middleName: { isSet: true } }

Logical Operators

AND (implicit)

Copy & paste — that's it
// Multiple conditions = AND
where: {
 email: { contains: '@prisma.io' },
 role: 'ADMIN'
}

AND (explicit)

Copy & paste — that's it
where: {
 AND: [
 { email: { contains: '@prisma.io' } },
 { role: 'ADMIN' }
 ]
}

OR

Copy & paste — that's it
where: {
 OR: [
 { email: { contains: '@gmail.com' } },
 { email: { contains: '@prisma.io' } }
 ]
}

NOT

Copy & paste — that's it
where: {
 NOT: {
 role: 'GUEST'
 }
}

// Multiple NOT conditions
where: {
 NOT: [
 { role: 'GUEST' },
 { verified: false }
 ]
}

Combined

Copy & paste — that's it
where: {
 AND: [
 { verified: true },
 {
 OR: [
 { role: 'ADMIN' },
 { role: 'MODERATOR' }
 ]
 }
 ],
 NOT: { deletedAt: { not: null } }
}

Relation Filters

some

At least one related record matches:

Copy & paste — that's it
// Users with at least one published post
where: {
 posts: {
 some: { published: true }
 }
}

every

All related records match:

Copy & paste — that's it
// Users where all posts are published
where: {
 posts: {
 every: { published: true }
 }
}

none

No related records match:

Copy & paste — that's it
// Users with no published posts
where: {
 posts: {
 none: { published: true }
 }
}

is / isNot (1-to-1)

Copy & paste — that's it
// Users with profile in specific country
where: {
 profile: {
 is: { country: 'USA' }
 }
}

// Users without profile
where: {
 profile: {
 isNot: null
 }
}

Array Field Filters

For fields like String[]:

Copy & paste — that's it
// Has element
where: { tags: { has: 'typescript' } }

// Has some elements
where: { tags: { hasSome: ['typescript', 'javascript'] } }

// Has every element
where: { tags: { hasEvery: ['typescript', 'prisma'] } }

// Is empty
where: { tags: { isEmpty: true } }

JSON Filters

Copy & paste — that's it
// Path-based filter
where: {
 metadata: {
 path: ['settings', 'theme'],
 equals: 'dark'
 }
}

// String contains in JSON
where: {
 metadata: {
 path: ['bio'],
 string_contains: 'developer'
 }
}

Full-Text Search

Copy & paste — that's it
// Requires @@fulltext index
where: {
 content: {
 search: 'prisma database'
 }
}