mongodb的聚合使用
1.原始数据:2.语句
(1)对字段进行分组求和,并显示字段(主要是把字段从ip中移出来,但是这种写法不提倡,因为多了一次$project管道,会降低性能)db.im_play_data.aggregate(
{ "$match" : { "video_type" : 1}},
{ "$group" : { "_id" : { "source" : "$source" , "video_id" :
原创
2017-01-23 15:18:41 ·
473 阅读 ·
0 评论