db.book_month_income.aggregate(
[
{
$group:{
_id:{pricePerKword:"$word_price",userId:"$user_id"},
count:{$sum:1}
}
}
,
{
$group: {"_id": { "pricePerKword" : "$_id.pricePerKword" }, count: { $sum : 1 } }
}
]
)
db.book_month_income.aggregate(
[
{
$group:{
_id:{pricePerKword:"$word_price",userId:"$user_id"},
count:{$sum:1}
}
}
,
{
$group: {"_id": { "pricePerKword" : "$_id.pricePerKword" }, count: { $sum : 1 } }
}
]
)