Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
Prisma deleteMany with a list of IDs

I'm wondering if there is a way in the Prisma Client to batch delete database records by id.

Something like this doesn't seem to exist:

const idsToDelete = [5, 29, 255]

prisma.post.deleteMany({
    where: {
        id: {
            equals: idsToDelete
        }
    }
})

The docs allude to the concept of Scalar List Filters, but this doesn't seem to be supported for numeric lists or perhaps isn't supported in deleteMany.

Under the hood, I'm hoping for a SQL DELETE ... WHERE IN clause. I'd prefer not to:

  • Spin up a bunch of individual JS promises
  • Use database-specific Prisma features (ok if it's not supported in MongoDB)
  • Write SQL directly
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the in operator:

    where: {
        id: {
            in: idsToDelete
        }
    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!