Reputation: 8550
I am doing an aggregate and on some stage i have following results:
[{ "_id" : 1, "array_field": [1, 2, 3]},
{ "_id" : 2, "array_field": [3, 2, 1]}]
I want to get the array_field sorted on next stage:
[{ "_id" : 1, "array_field": [1, 2, 3]},
{ "_id" : 2, "array_field": [1, 2, 3]}]
What is the possibilities? The $sort didnt helped me.
Upvotes: 1
Views: 2427