Mongodb multi-table grouping query

  mongodb, question

I now encounter such a problem:
There are now multiple collections in mongo
A set
Set b
C set

There are many documents stored in these three collections, in which the information ip of different computers and different types of types are recorded.
The format of the document is as follows:
The document format stored in A, B and C is as follows: {“Type”: Type 1/ Type 2 …; “ip”:; The general format is as follows
I need to cross three tables to find out the type and quantity of each ip computer. What should I do? If there is a set, it is better to implement it, but it needs to span multiple sets. How should it be implemented? ? The table of data finally realized is as follows:


Aggregation of data from three collection to one Collection ip:[type] and then aggregation?