How to sort sub-documents in the array field?
问题 I'm using the MongoDB shell to fetch some results, ordered. Here's a sampler, { "_id" : "32022", "topics" : [ { "weight" : 281.58551703724993, "words" : "some words" }, { "weight" : 286.6695125796183, "words" : "some more words" }, { "weight" : 289.8354232846977, "words" : "wowz even more wordz" }, { "weight" : 305.70093587160807, "words" : "WORDZ" }] } what I want to get is, same structure, but ordered by "topics" : [] { "_id" : "32022", "topics" : [ { "weight" : 305.70093587160807, "words"