Skip to content

Commit

Permalink
fix: currency aggregation returning multiple activities on related ac…
Browse files Browse the repository at this point in the history
…tivity types
  • Loading branch information
sylvanr committed Aug 22, 2024
1 parent 456d56f commit b42c6f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions direct_indexing/custom_fields/currency_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ def get_child_aggregations(dba, aggregation_fields):
# {MONGO_UNWIND: "$related-activity"},
{"$unwind": "$related-activity"},
{"$match": {"related-activity.type": 1}},
{'$group': {
'_id': '$_id',
'uniqueActivity': {
'$first': '$$ROOT'
}
}},
{'$replaceRoot': {'newRoot': '$uniqueActivity'}},
{"$group": group_object}
# {MONGO_GROUP: group_object}
]))
Expand Down

0 comments on commit b42c6f7

Please sign in to comment.