I want to apply group by only on one filed with Spring Boot and MongoDB. Let say I've one collection in Mongo which consist following fields
{
"_id": {
"$binary": {
"base64": "RZX+2GWyTD2DWyD/01ZPmA==",
"subType": "04"
}
},
"categoryType": "CRICKET",
"description": "I like Cricket",
}
{
"_id": {
"$binary": {
"base64": "RZX+2GWyTD2DWyD/01ZPmA==",
"subType": "04"
}
},
"categoryType": "FOOTBALL",
"description": "I love Footbal",
}
{
"_id": {
"$binary": {
"base64": "RZX+2GWyTD2DWyD/01ZPmA==",
"subType": "04"
}
},
"categoryType": "CRICKET",
"description": "I love Cricket",
}
{
"_id": {
"$binary": {
"base64": "RZX+2GWyTD2DWyD/01ZPmA==",
"subType": "04"
}
},
"categoryType": "Martial Art",
"description": "Martial Art",
}
{
"_id": {
"$binary": {
"base64": "RZX+2GWyTD2DWyD/01ZPmA==",
"subType": "04"
}
},
"categoryType": "FOOTBALL",
"description": "Football",
}
My purpose is to display records by their group. So how I can apply group by with Spring Boot and MongoDB?