db.getCollection('product_protocol_new').aggregate([
{$sort:{"end_date":-1}},
{$group:{
_id:"$company_protocol", end_date:{"$first":"$$ROOT"},
}}
])
zjdeblog 2018-08-16 09:28 原文
db.getCollection('product_protocol_new').aggregate([
{$sort:{"end_date":-1}},
{$group:{
_id:"$company_protocol", end_date:{"$first":"$$ROOT"},
}}
])