FindIn
Exatamente a mesma funcionalidade que findBy, mas procura entidades em um intervalo de valores. O retorno é uma matriz da entidade.
const propertyName = { id : 'id' };
const baseData = [3, 4, 6, 7, 8, 9];
const select = { name: true }
const exampleArray = await this.examplesRepository.findIn(
{
where: { id: [3, 4, 6, 7, 8, 9] },
relations: ["relation-1", "relation-2"], // ou { "relation-1": true, "relation-2": true }
order: { id: 'ASC' },
select,
},
trx,
);
// Busca todos e seleciona name onde id entre = "3, 4, 6, 7, 8, 9"
output: [exampleArray]
Was this helpful?