is it possible to get a hash/object back from pris...
# orm-help
w
is it possible to get a hash/object back from prisma instead of rows? I want to pull back a result set, but rather than looping through the results, I want to pull specific rows based on a unique column value
b
Sounds like you might want something like this:
Copy code
const res = await prisma.table.findMany({
  where: { id: { in: [1, 3, 18, 44] } }
});
const resMap = res.reduce(
  (acc, r) => { acc[r.id] = r; },
  {}
);
👍 2