Using count to count notification having acknowledgement false


I want to count notification having acknowledgement false. So, I have write this

userNotification as var(func: uid(0xf7ead)){
notification @filter(eq(notification_acknowledgement, false)){
getNotificationCounter(func: uid(userNotification)){
notificationCounter : count(notification)

But output is always give count of total notification not only those having acknowledgement false.

Please help me where I am wrong.

Hi, can you do it all in one query. Something like

q(func: uid(0xf7ead)){
  num_notifications : count(notification @filter(eq(notification_acknowledgement, false)))

There’s an example of counts and filters in this section of the docs (last example before next section)

@michaelcompton Thanks, it worked for me

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.