Skip to content

Instantly share code, notes, and snippets.

@willwillis
Created July 12, 2021 20:56
Show Gist options
  • Save willwillis/ee5dbc8673c8d404286a4daac10bb0ee to your computer and use it in GitHub Desktop.
Save willwillis/ee5dbc8673c8d404286a4daac10bb0ee to your computer and use it in GitHub Desktop.
Where clause on DateTime field, Prisma Client
import { PrismaClient, Prisma } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const user = await prisma.user.findMany({
where: {
createdAt: {
gte: '2020-07-20T22:17:24.915Z'
}
}
});
console.log(user);
}
main()
.catch((e) => {
throw e;
})
.finally(async () => {
await prisma.$disconnect();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment