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

204
Views
findFirst does not working with 3 filters on Prisma

I'm having this problem when I want to check if I have at least one record with the parameters. With 2 filters it works fine, but with 3 it's not working.

await prismaClient.t_endereco
                .findFirst({
                    where: {
                        logradouro, (string)
                        bairro, (string)
                        numero, (number)
                    },
                })

the condition to update the record is not having another identical.

i tried to use AND too:

await prismaClient.t_endereco
                .findFirst({
                    where: {
                        AND:[
                              {logradouro}, 
                              {bairro}, 
                              {numero},  
                            ]
                        
                    },
                })

same issue.

someone to help me with this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try the follow:

const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

prisma.category.findFirst({
  where: {
    OR: [
      { id: 2 },
      { name: 'new' },
      { description: 'd1' },
    ],
  },
})
.then(data => {
  console.log(data)
})
.catch(error => {
  console.error(error)
})

You can check the documentation for more information

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!