select username,sum(seconds) from biao group by username
实现这个功能 我用下面的聚合数据集,为啥不对呢?该怎么写?
{_id:"$userName", seconds:{$sum: 1}}
没用过,参考下这个
https://chat.baidu.com/search?dyTabStr=MCwzLDEsMiwxMyw3LDYsNSwxMiw5&pd=csaitab&setype=csaitab&extParamsJson=%7B%22apagelid%22%3A%229821458963106510188%22%2C%22enter_type%22%3A%22a_ala%22%2C%22ori_lid%22%3A%229821458963106510188%22%2C%22srcid%22%3A%2260601%22%2C%22order%22%3A%22left_3%22%2C%22tplname%22%3A%22ai_agent_distribute%22%2C%22sa%22%3A%22re_dl_agent_ala%22%7D&word=mongodb%E5%88%86%E7%BB%84%E6%9F%A5%E8%AF%A2%E8%AF%AD%E6%B3%95&agentInfo=%7B%22agentSearchId%22%3A%2216%22%2C%22isUpperBox%22%3Atrue%2C%22agentId%22%3A%2216%22%2C%22agentName%22%3A%22%E6%96%87%E5%BF%83%E5%BF%AB%E7%A0%81BaiduComate%22%2C%22agentParams%22%3A%7B%22isQ2c%22%3A1%2C%22content_build_id%22%3A%221427c17%22%2C%22app_key%22%3A%22OREY3deJH7EWBlgOKRXxVmGnT44swyhU%22%2C%22agent_id%22%3A%22c816%22%7D%2C%22startIndex%22%3A0%2C%22endIndex%22%3A15%7D