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

497
Views
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
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!