eleven26

  • Home
  • Tags100
  • Archives346
  • Table of Contents
  • Overview

eleven26

346 posts
100 tags

mongodb 分组统计

Posted on 2022-06-13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
db.getCollection('cart').aggregate([
{
$match: {
"company_id": 2057013
}
},
{
$group: {
_id: {
"self_company_id": "$self_company_id",
"user_id": "$user_id",
},
total: {
$sum: 1
}
}
},
{
$sort: {total: -1}
}
])
MongoDB
golang中defer的关键特性示例讲解
各种系统添加开机启动项
© 2025 eleven26
Powered by Hexo & NexT.Mist
0%