I got an error:
→ 60 const schools = await this.prisma.school.findMany(
The columnt4.id
does not exist in the current database.
The error will only disappear when i remove the line:214-216
. But I can’t remove these lines since I want to filter the semesters
.
const schools = await this.prisma.school.findMany({
where: {
semesters: {
some: {
isActive: true,
subjects: {
none: {},
},
},
},
},
select: {
id: true,
name: true,
semesters: {
where: {
isActive: true,
subjects: { // line:214
none: {} // line:215
} // line:216
},
select: { id: true, subjects: { select: { id: true } } },
},
},
take: 100,
});
I know it can be done by the following, but I prefer to the above process.
const schools = ...
const filteredSchools = schools.map(...).filter(...);