Created
July 12, 2021 20:56
-
-
Save willwillis/ee5dbc8673c8d404286a4daac10bb0ee to your computer and use it in GitHub Desktop.
Where clause on DateTime field, Prisma Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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