Get most recent Sub-Document from Array
问题 I have an array. I would like to select the object with the highest revision number from my history arrays (plural). My document looks like this (often it will be more than just one object in uploaded_files ): { "_id" : ObjectId("5935a41f12f3fac949a5f925"), "project_id" : 13, "updated_at" : ISODate("2017-07-02T22:11:43.426Z"), "created_at" : ISODate("2017-06-05T18:34:07.150Z"), "owner" : ObjectId("591eea4439e1ce33b47e73c3"), "name" : "Demo project", "uploaded_files" : [ { "history" : [ {