Is it possible to do this transformation using `db.query`?

Hello! Can I get rid of other columns and keep only tag?

return ctx.db.query.bookmark.findMany({
        with: {
          tags: {
            with: {
              tag: {
                columns: { id: true, name: true },
              },
            },
          },
        },
});


to get:
{
 ...
 tags: [
   { id: '..', name: 'terminal' },
 ],
}
image.png
Was this page helpful?