Database

[{/**-- type and date*/"date":"2023-11-09","type":"my_type","resources":"1111,5555,2222,3333,1111"},{/**-- type and date*/"date":"2023-11-09","type":"my_type","resources":"1111,6666,2222,3333,1111"}]

Query

db.collection.aggregate([{$match:{date:"2023-11-09"}},{"$group":{_id:"",tot:{"$addToSet":{$split:["$resources",","]}}}},{"$project":{total:{$size:{"$reduce":{"input":"$tot","initialValue":[],"in":{"$setUnion":["$$this","$$value"]}}}}}}])

Result