Dev__
06/10/2021, 2:17 PMinclude but its not working. the relation sort does work at the orderBy
where,
include: {
buyerGroupDescriptions: {
where: {
languageId
},
orderBy: {
name: order // 'asc' or 'desc', not working
}
}
}
orderBy: {} // workingRyan
06/10/2021, 2:18 PMDev__
06/10/2021, 2:22 PMmodel BuyerGroup {
id String @id @db.VarChar(255)
...
buyerGroupDescriptions BuyerGroupDescription[]
}
model BuyerGroupDescription {
id String @id @db.VarChar(255)
buyerGroupId String @db.VarChar(255)
languageId String @db.VarChar(255)
name String @db.VarChar(255)
...
buyerGroup BuyerGroup @relation(fields: [buyerGroupId], references: [id])
language Language @relation(fields: [languageId], references: [id])
@@unique([buyerGroupId, languageId])
}
I cant sort in the orderBy because then the relation buyerGroupDescriptions has a _count so I am forced to do it inside the includeRyan
06/10/2021, 2:27 PMinclude only.Ryan
06/10/2021, 2:27 PMDev__
06/10/2021, 2:28 PMDev__
06/10/2021, 2:28 PMRyan
06/10/2021, 2:29 PMDev__
06/10/2021, 2:32 PMDev__
06/10/2021, 2:33 PMRyan
06/10/2021, 2:39 PM