Hello everyone I have model Posts (f.e.) In this m...
# orm-help
o
Hello everyone I have model Posts (f.e.) In this model there is field published - boolean Is it possible to get count of published and not published posts? thank you! EDIT: I need smth like this:
Copy code
SELECT published, COUNT(*) FROM Posts GROUP BY published
EDIT 2: I need this, but in relation:
Copy code
const data = await prisma.posts.groupBy({
        by: ["published"],
        _count: {
          published: true,
        },
      });
n
Hey Oleg 👋 It seems that you are looking for nested relationships count in groupBy. Can you have a look at this Feature Request? Does this fit your use case?