I’d start with an $unwind on the users and then re-group using a $group with the new ID being the user ID, you can then $addToSet the orders to get a distinct list of them, you can also probably run a reduce on the items to get an array of the item names then run another stage after that to get a count of items in the unique set.
If you have a massive dataset this could be slow due to the unwind, in which case you could build it gradually by filtering the input data and effectively running in batches.

3 Likes