It seems like this should error out. Example:
> db.set.update({}, {$push : {a : {$each : [{"title" : "x", "rating" : 6}, {title:"y", "rating" : 3}, {title:"z", rating:10}]}}}, true)
> db.set.update({}, {"$push" : {"a" : {"$sort" : {"a.rating" : 1}}}})
> db.set.find().pretty()
{
"_id" : ObjectId("512b8e6dae74c67969e404cc"),
"a" : [
{
"title" : "x",
"rating" : 6
},
{
"title" : "y",
"rating" : 3
},
{
"title" : "z",
"rating" : 10
},
{
"$sort" : {
"a.rating" : 1
}
}
]
}