There are many factors that can affect the performance of a query. Browse through this MongoDB documentation topic on Aggregation Pipeline Optimization.
An important aspect that can affect the performance is the Indexes. See Indexing Strategies for a few ideas.
Tell about a few things about your data, like:
Are there any indexes created on the collections (db.collection.getIndexes() returns the list of indexes)
What is the version of the MongoDB you are working with
In case you have already defined indexes on the collections, you can also generate a Query Plan, which tells about any indexes used (or not) and also can have information about why the query is taking a long time. The db.collection.explain() can be used with your aggregation query to get a query plan (use this with the verbosity of “executionStats”).
@le_an, please followup on this. Give us some details about how you resolve your issue. This is as a courtesy to Prasad_Saya and to me for taking the time to reply and to others so they know the information provided is reliable.