K
K
komigor2021-08-05 15:15:22
PostgreSQL
komigor, 2021-08-05 15:15:22

How to get a field in the type orm by the value of the array element in the field?

I have a table in which one of the fields is an array (user phone numbers) and I need to get a string by one of the values ​​of this array. That is, I get a phone number and then if there are such values ​​​​inside the array, then I get this user. How to do it in type orm?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
komigor, 2021-08-06
@komigor

getRepository(Client).createQueryBuilder("user").where(`:tel = any(phone);`, {tel: phoneNumber}).getOne();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question