I have a scenario where I am accepting a list of IDs in my request, for example [1,2,3]
. How can I use typeorm
and querybuilder
to retrieve only objects with these IDs from my database?
I attempted the following:
if(dto.customersIds){
Array.prototype.forEach.call(dto.customersIds, ids => {
res.where(`customer.id = ${ids}`);
})
}
However, this approach did not work as it only retrieved the object with the last ID in the array.
Could someone please advise me on how to retrieve objects by their IDs?
Thank you for any assistance provided.