How does mongodb use aggregate to count the total number of non-duplicated fields in a group?

there is data like this:

clipboard.png

I want to use aggregate to group group by p, and then count the sum of ac, cc in each province, which can be done. The question is: I want to count the total number of tc in each province (do not repeat)? For example, Fujian is 3, Guangdong is 1, Hubei is 1, what method can be used to do so?

Feb.28,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9a20f-47584.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9a20f-47584.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?