Answer the question
In order to leave comments, you need to log in
How to extract data from typeorm index array?
Example for everyone
I have an array with user IDs
[1, 2, 3, 4] in my table.
Is it possible to extract information for each using typeorm?
Answer the question
In order to leave comments, you need to log in
Can. Documentation.
If these are just IDs without any connection, you can use In :
import {In} from "typeorm";
const users = await connection.getRepository(User).find({
ids: In([1, 2, 3, 4])
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question