You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my first post issue of all my life. I love programming, you're inspiration for me... so, let's begin:
My schema is huge, so i will try to explain:
· 1 guide has many components
· 1 components has many tags
· 1 tag has many aspects
· 1 aspect has many items
but also:
· 1 guide_approvement has fk aspect_id, fk item_id, fk guide_id, fk department_id
· the aspects and the items must recieve a rating
this is the thing: i´m doing pretty well the query but i can´t add many filters, i need select rating active = true AND department_id = userDepartmentId and others, but i just can do well the where id: guide?.id at the beggining
Reading the documentation i tried to do nested where with: where: { table: { is: { field: value ... but i recieve this error "Provided Json, expected Int."
In the following lines you will see errors, it's in purpose, that's i want to approach:
This is my first post issue of all my life. I love programming, you're inspiration for me... so, let's begin:
My schema is huge, so i will try to explain:
· 1 guide has many components
· 1 components has many tags
· 1 tag has many aspects
· 1 aspect has many items
but also:
· 1 guide_approvement has fk aspect_id, fk item_id, fk guide_id, fk department_id
· the aspects and the items must recieve a rating
this is the thing: i´m doing pretty well the query but i can´t add many filters, i need select rating active = true AND department_id = userDepartmentId and others, but i just can do well the where id: guide?.id at the beggining
Reading the documentation i tried to do nested where with: where: { table: { is: { field: value ... but i recieve this error "Provided Json, expected Int."
In the following lines you will see errors, it's in purpose, that's i want to approach:
let data = { table: "guide", action: "get", // findUnique body: { where: { // not work id: { is: { id: valueGuide?.id, }, }, }, select: { id: true, date: true, version: true, component_guide: { select: { component: true, }, orderBy: { id: "asc", }, }, tag_guide: { select: { tag: true, }, orderBy: { id: "asc", }, }, aspect_guide: { select: { aspect: true, }, orderBy: { id: "asc", }, }, item_guide: { select: { item: true, }, orderBy: { id: "asc", }, }, guide_approvement: { select: { comment: true, aspect_guide_id: true, item_guide_id: true, rating: { select: { value: true, where: { // not work is: { active: true, }, }, }, }, }, where: { // not work departament_id: user.departament.id, }, }, }, }, };
prisma.table.findUnique(url, data)
Hope your help, thanks a lot
The text was updated successfully, but these errors were encountered: