db.runCommand(

{

  group:

  {

    ns:"testc",

    key:{name:null},

    initial:{num:0},

   $reduce:function(doc,prev)

   {

      prev.num++;

  }

 }

}

)

 

{

   "retval":[

      {

       "name":"sulin",

      "num":1

   }

  ,

   {

    "name":"lihui",

   "num":1

   }

],

    "count":2,

   "keys":2,

   "ok":1

}

)

}

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2021-10-01
  • 2021-08-22
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
猜你喜欢
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案