In my data model, I have users and events performed by those users.
A user is represented by a parent document. The events are child documents.
I would like to do a query where I say, "Find parents who have done event X (ie who have a child of X), and show me (for example) the most common event each parent has done. (ie for each parent look at its children and perform one aggregation per parent)"
Is there any way to do that?