eg:
tmb_results_by_tissue_other raw data:
{"base_info":[1,2,3],"type":"123"}, {"base_info":[2,3,4,5],"type":"123"},
in aggregate
db.tmb_results_by_tissue_other.aggregate([{$project:{"type":1, num:{$size:"$base_info"}}},{$sort:{"num":-1}}])
source share