It is not really common to have dots in field names.
I usually avoid working with dynamic and arbitrary keys as it makes life harder. I use the attribute pattern and then it becomes easy because a simple $group can be use.
You could always use $objectToArray to transform your data to a dynamic attribute pattern and the use $group as above. But if you frequently do this aggregation you might as well store the data using the pattern and save the extra step doing the $objectToArray.