I'm still trying to figured out to achieve this using Mongo. Hope anyone here can teach me and help me with my problem.
Here's my schema
const User = {
table: 'User',
schema: {
_id: {
name : 'Id',
type: db.keyType(),
required: true
},
email: {
name: 'Email',
type: String,
required: true,
unique: true
},
}
}
desired results "19-12" is 19 = 2019 year and month 12 = December
{
"19-12": "5",
"20-1": "22",
"20-2": "20",
"20-3": "4",
}
question from:
https://stackoverflow.com/questions/65912554/group-results-per-month-using-mongo 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…