0

I have user: { name: 'Patrick', ... }

I have an array like: ['Patrick, 'James']

I want to find all users depending on my array. I ended up with something like this:

models.User.findAll({
        where: { name: {
            $in: names
          }
        }
      })

but it throws error. Also I tried this:

models.User.findAll({
    where: { name: {
        $like: { $any: names }
      }
    }
  })

But it also fails. How to find all this users, when I have an array with names?

patys
  • 34
  • 5

0 Answers0