Good afternoon, I'm a junior dev who's been trying to learn Sequelize with Typescript but am having difficulties. I've created a simple query to search based off a value, but am unable to pass an array of values without breaking the query.
const findNameTsxData = (limit: number, Name: string): Promise<FinanceStuffs[]> => {
// const { in: opIn, or } = Sequelize.Op;
return db.FinanceStuffs.findAll({
where: { Name },
limit
});
};
Right now, if i pass a query on postman as
Name: "Joe"
Limit: 10,
It returns me 10 transactions by Joe, but i'd like to be able to pass multiple names in the query such as:
Name: ["Joe", "Alex", "Jacob"]
Limit: 30
I believe the answer would be mapping the array somehow, or using Sequelize.Op but i seem to be getting multiple typescript errors when tried.
If you could explain to me what i'm doing wrong, it would be greatly appreciated as a learning experience.
Thank you!