Emi
Emi
PPrisma
Created by Emi on 4/22/2024 in #help-and-questions
Prisma filter variable in given array
I have an array position:["GK","CDM","CF"] and I have a model Player { id Int @id @default(autoincrement()) name String
age Int? position String? } I need to filter position field if it has any of the given positions in position array. How should I do that? I tried this way but it doesn't work
position:
parsedFilters.positions && parsedFilters.positions.length > 0
? {
position: {
in: parsedFilters.positions,
},
}
: null,
position:
parsedFilters.positions && parsedFilters.positions.length > 0
? {
position: {
in: parsedFilters.positions,
},
}
: null,
3 replies
PPrisma
Created by Emi on 4/19/2024 in #help-and-questions
Support case insensitive advanced Json filtering
There is no support for case insensitive advanced JSON filtering on Prisma When we can expect Prisma to solve this, it would be a really good feature!
{
applicantData :{
path: ["details", "lastName"],
string_contains: searchString,
}
}
{
applicantData :{
path: ["details", "lastName"],
string_contains: searchString,
}
}
1 replies
PPrisma
Created by Emi on 4/19/2024 in #help-and-questions
How good is Prisma with Json fields?
I'm struggling to decide which DB to use with Prisma for Json objects? I will need to have filters for fields in Json object which looks like this, it has many fields... my questions are: is Prisma good for handling Json objects and would it be better to use MongoDB instead of Postgre? details: { attacking: { goals, assists, ... }, defending: { interceptions .... }, passing: { passes, successfull passses, .... }, },
1 replies
PPrisma
Created by Emi on 4/11/2024 in #help-and-questions
prisma nested fields
is it okay in terms of performance to have many nested fields in prisma?

const user = await prismadb.user.findUnique({
where: { id },
include: {
licenses: {
include: {
subscription: {
include: { organization: { include: { admin: true } } },
},
},
},
},
});

const user = await prismadb.user.findUnique({
where: { id },
include: {
licenses: {
include: {
subscription: {
include: { organization: { include: { admin: true } } },
},
},
},
},
});
4 replies