Jared Fraser
09/24/2021, 5:58 AMonly
filter for 1-N
relations?
Currently the options for every
, some
and none
are limiting.
It would be good to query
children: {
only: {
field: "value"
}
}
and it would return children that only match the filterRyan
09/27/2021, 6:44 AMsome
also returns the parent items that have at least 1 exact match for the filter in the relations.Jared Fraser
09/27/2021, 6:51 AMmodel Parent {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
children Child[] @relation("")
}
model Child {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
parent_id String @db.Uuid
parent Parent
created_at DateTime @default(dbgenerated("now():::TIMESTAMPTZ")) @map("created_at") @db.Timestamptz(6)
}
and I wanted to get a parent and the children that where created on a certain date, but not other children created on another date, is that possible with some
?