How can i string filter but for number?
Hey im still new to prisma and basically i want this getId Method to work:
async test(id)
this.prisma.idTable.findMany({
where: {
id: {contains: id}
})
but apparently it only works for strings and toString the id doesnt work aswell so helpp?3 Replies
Hi @Slyding 👋
if
id
is a number, you can simply do:
If your id
field is a string and you want to use the contains filter.my id is a number but i want to fetch in my id table all rows where it contains the id. my problem is,
where: {
id: id
only gives result if its the exact ID but i dont know
thanks for the response tho! @RaphaelEtimCan you give some examples of the IDs? Out of interest, what’s the usecase for this