如何在mongodb中使用$ Count

时间:2018-12-28 03:23:50

标签: node.js mongodb count aggregation-framework

我有一个收藏如下:

{ "_id" : ObjectId("5c2493935634e4300000000c"), "typeCall" : "Internal", "date" : "2018-12-27", "starttime" : "2018-12-27 15:55:43", "endtime" : "2018-12-27 15:55:46", "source" : "21000", "destination" : "22000", "duration" : "3", "billsec" : "0", "disposition" : "NO ANSWER", "channel" : "SIP/21000-00000018", "destinationchannel" : "SIP/22000-00000019", "uniqueid" : "1545900943.24" }
{ "_id" : ObjectId("5c2498915634e4300000000d"), "typeCall" : "Internal", "date" : "2018-12-27", "starttime" : "2018-12-27 16:17:02", "endtime" : "2018-12-27 16:17:05", "source" : "21000", "destination" : "22000", "duration" : "2", "billsec" : "0", "disposition" : "NO ANSWER", "channel" : "SIP/21000-0000001a", "destinationchannel" : "SIP/22000-0000001b", "uniqueid" : "1545902222.26" }
{ "_id" : ObjectId("5c2498e25634e4300000000e"), "typeCall" : "Internal", "date" : "2018-12-27", "starttime" : "2018-12-27 16:18:23", "endtime" : "2018-12-27 16:18:26", "source" : "21000", "destination" : "22000", "duration" : "3", "billsec" : "0", "disposition" : "NO ANSWER", "channel" : "SIP/21000-0000001c", "destinationchannel" : "SIP/22000-0000001d", "uniqueid" : "1545902303.28" }
{ "_id" : ObjectId("5c24990d5634e4300000000f"), "typeCall" : "Internal", "date" : "2018-12-27", "starttime" : "2018-12-27 16:19:05", "endtime" : "2018-12-27 16:19:09", "source" : "21000", "destination" : "22000", "duration" : "3", "billsec" : "0", "disposition" : "NO ANSWER", "channel" : "SIP/21000-0000001e", "destinationchannel" : "SIP/22000-0000001f", "uniqueid" : "1545902345.30" }

如何导出表格,如下所示:

enter image description here

0 个答案:

没有答案