https://blog.csdn.net/congcong68/article/details/51620040

mongodb aggregate多个分组条件

db.test.aggregate(

     {

          $group:{

                _id:{name:'$name',pro:'$pro},

                total:{$sum:'$num'}

          }

      },

     {

         $project:{

             total:1

        }

    }

)

mongodb-聚合(2)

相关文章:

  • 2021-08-25
  • 2021-10-11
猜你喜欢
  • 2021-07-30
  • 2021-06-24
  • 2021-04-19
  • 2021-12-05
  • 2021-04-16
相关资源
相似解决方案