Where not in query error invalid input syntax for type bigint typeorm

  Kiến thức lập trình

i was working on a project and i need to use “where not in” query like this

return manager
  .getRepository(SlideshowItemEntity)
  .createQueryBuilder('slideshow_items')
  .softDelete()
  .where('image_id NOT IN (:imageIDs)', { imageIDs: imageIDs.join(',') })
  .andWhere('slideshow_id = :slideshowID', { slideshowID: slideshowID })
  .execute();

but when i run the query it returns error

invalid input syntax for type bigint: "1,2,3"

how can i solve this?
i want to delete all slideshow items except some with image_id 1,2,3

my database is postgresql and i am using nestjs and typeorm

thanks for any answers.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT