I have schema:
{
userName: String
postCount: Number,
commentCount: Number,
abuseCount: Number,
}
I need get sum all users counts all fields in result
example
{
"userName": "John"
"postCount": 5,
"commentCount": 1,
"abuseCount": 4,
}, {
"userName": "Bob"
"postCount": 11,
"commentCount": 41,
"abuseCount": 3,
}, {
"userName": "Alex"
"postCount": 2,
"commentCount": 15,
"abuseCount": 6,
}
result must be ~
{
"postCount": 18, (sum all postCount field users)
"commentCount": 57,
"abuseCount": 10,
}
How I can do this? Thx!