Missing nested where clause

If you see here i'm missing the ability to do a where filter on the nested rawDetails table

The docs say you can do so

await db.query.posts.findMany({
  where: (posts, { eq }) => (eq(posts.id, 1)),
  with: {
    comments: {
      where: (comments, { lt }) => lt(comments.createdAt, new Date()),
    },
  },
});

My relations below

export const rawCardsRelations = relations(rawCards, ({ one }) => ({
    rawDetails: one(rawDetails),
}))

export const rawDetailsRelations = relations(rawDetails, ({ one }) => ({
    rawCards: one(rawCards, {
        fields: [rawDetails.rawCardsId],
        references: [rawCards.id],
    }),
}))
image.png
Was this page helpful?