I read the documentation in the MongoDb and I used a simple proves and I only look that:
Push is sorting the array but addtoSet isn\'t it.
For me visual
$push: Inserts the value to an array in the resulting document. eg;
db.mycol.aggregate([{$group : {_id : "$by_user", url : {$push: "$url"}}}])
$addToSet: Inserts the value to an array in the resulting document but does not create duplicates. eg;
db.mycol.aggregate([{$group : {_id : "$by_user", url : {$addToSet : "$url"}}}])