MongoDB去重

对MongoDB的数据中某一列进行去重,可直接使用aggregate聚合函数和distinct去重函数 table.aggregate([{'$match': {}}, {'$group': {'_id': "$id1"}}, {'$sort': {'count': -1}}])mongodb table.distinct('id1',{Queryconds})
相关文章
相关标签/搜索