Currently MongoDB compares the subdocuments by comparing the BSON data, and it doesn’t check the contents in the subdocuments. So when you use $addToSet to add subdocuments to an array, if the order of the fields in the subdocuments are different, they would be considered as different documents even if the values for all the fields in the subdocuments are the same.
It would be nice to document this behaviour for $addToSet