M Zeeshan
M Zeeshan•7mo ago

I have an array of category IDs. How can

I have an array of category IDs. How can I retrieve all corresponding categories from the categories table?
5 Replies
Hmza
Hmza•7mo ago
const categories = await Promise.all( categoryIds.map(async (id) => { return await ctx.db.get("categories", id); }) );
lee
lee•7mo ago
(much to my disappointment, db.get only takes one argument, so remove the "categories" first argument)
M Zeeshan
M ZeeshanOP•7mo ago
thx... it worked without first "categories" arg
Hmza
Hmza•7mo ago
petition to make it more abstract like this
lee
lee•7mo ago
actively working on it 🙂

Did you find this page helpful?