use `count` in db.query?

export function queryQuestions() {
  return db.query.questionsTable.findMany({
    limit: 5,
    orderBy: ({ createdAt }, { desc }) => desc(createdAt),
    with: {
      author: true,
      answers: {
        extras: //
      } 
    },
  })
}

I am not fully understanding the API, require support
Solution
https://orm.drizzle.team/docs/rqb#include-custom-fields


As of now aggregations are not supported in extras
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Was this page helpful?