Hi @Idriss_57202,
Welcome to the MongoDB Community forums 
To understand your use case better, could you please provide further details, such as:
- The sample document from your MongoDB dataset.
- The MongoDB Version you are using.
- The expected result documents.
- Any queries that you have tried to achieve the required results?
Could you please quantify the amount of data – or
- share the output of
db.<coll_name>.stats(),
- the number of documents in your collection,
- details of the indexes you have created, and
- also the explain output of the aggregation operation you have performed?
With these specifics, community should be able to better assist you. Also, feel free to sanitize any sensitive field names or values.
Look forward to hearing from you.
Regards,
Kushagra