akku
06/28/2022, 3:03 AMInvites
every minute, with each having an expiry
field. How can I use prisma.invite.deleteMany
and select all documents where the expiry
date is in the past?akku
06/28/2022, 4:41 AMakku
06/28/2022, 4:41 AMimport { toDate } from "date-fns";
import prisma from "../utils/prisma.mjs";
const cleanupInvites = await prisma.invite.deleteMany({
where: {
expiry: {
lte: toDate(Date.now()),
},
},
});