Database

[{_id:"AAPL",income_statement:{annual:[{fiscalDateEnding:"2021-09-30",totalRevenue:"363172000000"},{fiscalDateEnding:"2020-09-30",totalRevenue:"271642000000"},{fiscalDateEnding:"2019-09-30",totalRevenue:"256598000000"},{fiscalDateEnding:"2018-09-30",totalRevenue:"265595000000"},{fiscalDateEnding:"2017-09-30",totalRevenue:"229234000000"}]}}]

Query

db.collection.aggregate([{"$unwind":"$income_statement.annual"},{$sort:{"income_statement.annual.fiscalDateEnding":1}},{$group:{_id:"$_id",annual:{$push:"$income_statement.annual"}}},{"$project":{_id:1,income_statement:{annual:"$annual"}}}])

Result