How do I use `where` inside `with`?

There's this example on the query() page (https://orm.drizzle.team/docs/rqb)

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


But I'm getting a TypeScript error saying there could be no where inside
with
. I'm on drizzle-orm 0.29
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Was this page helpful?