Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

505
Vistas
Why does find method return empty array in typeorm
  async create(
gPriceChangeDto: GPriceChangeDto,
gainerEntity: GainerEntity,
): Promise<GPriceChangeEntity> {
const findGPriceChange = await this.gPriceChangeRepository.find();
const priceChange = await this.gPriceChangeRepository.create(
  gPriceChangeDto,
);
console.log(findGPriceChange); // []
priceChange.gainer = gainerEntity;
await this.gPriceChangeRepository.save(priceChange);
await this.gPriceChangeRepository.delete(
  findGPriceChange?.map((item) => {
    return item.id;
  }),
);
return priceChange;
}

I have a problem that when I call the find method, it returns an empty array to me. I have a "OneToOne" relation in a file. And in the console I get this error.

[Nest] 8687  - 03/11/2022, 9:47:30 PM   ERROR [Scheduler] TypeORMError: Empty 
criteria(s) are not allowed for the delete method.
[Nest] 8687  - 03/11/2022, 9:47:30 PM   ERROR [Scheduler] TypeORMError: Empty 
criteria(s) are not allowed for the delete method. I am using nestjs.
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda