I am trying to aggregate a count of rows where fie...
# orm-help
d
I am trying to aggregate a count of rows where field is null, what am I doing wrong? 😄
Copy code
const countOfUnreadEvents = await prisma.event.aggregate({
    _count: {
      isRead: true,
    },
    where: {
      isRead: null,
    },
  });
Self answered 😄
Copy code
const countOfUnreadEvents = await prisma.event.count({
    where: {
      isRead: { equals: null },
    },
  });
😄 1
r
The former should work as well. Is there any difference in the queries generated?