mongodb實現類似sql中distinct的效果

如果想在mongo中實現以下sql的效果: SELECT DISTINCT i.city,i.region from iplocation i where i.country_name = 'China',把iplocation 中的中國的城市去重列出; 對應的mongodb命令是: db.getCollection('location')  .aggregate([      {"$match"
相關文章
相關標籤/搜索