Sort collection on document ordernumber and sort subarray on subarray objectorder

We just launched mongodb 5.2 and it appears it has $sortArray() in aggregation for just this.

2 Likes