Student Collection
{
"_id": {
"$oid": "6390fd9ddb26129a8832e330"
},
"name": "Sabarirajan",
"username": "testuser",
"schoolId": "639092e21a1df07c4664eb46",
"grade": 7,
"type": "user",
"email": "sabari@thecocoon.in",
"email1": "sabari1@thecocoon.in",
"email2": "sabari1@thecocoon.in",
"mobile": {
"$numberLong": "9840204606"
},
"mobile1": {
"$numberLong": "9840204606"
},
"section": "ab",
"birthdate": "2022-01-01",
"uid": "5d04e5d6-e533-462d-bf26-4fac7d1982c4",
"createdOn": "b7665281-c34a-4b9c-a0db-764d89e600f5",
"projectDetails": [
{
"projectId": {
"$oid": "6370d25ad4baaabdef7df774"
},
"groupId": {
"$oid": "636f2ae52fe088dd1654e3be"
}
},
{
"projectId": {
"$oid": "6370d27cd4baaabdef7df775"
},
"groupId": {
"$oid": "636f2bc32fe088dd1654e3c0"
}
}
]
}
Project Collection
{
"_id": {
"$oid": "6370d25ad4baaabdef7df774"
},
"name": "Project-1",
"id": 1,
"modifiedBy": "b7665281-c34a-4b9c-a0db-764d89e600f5",
"modifiedOn": {
"$date": {
"$numberLong": "1670753074882"
}
},
"title": "Grade -1 (test)",
"displayName": "Grade -1 (test)",
"type": "okjlkj",
"groups": [
{
"$oid": "636f2ae52fe088dd1654e3be"
},
{
"$oid": "636f2bc32fe088dd1654e3c1"
}
]
}
Group Collection
[{
"_id": {
"$oid": "636f2ae52fe088dd1654e3be"
},
"id": 1,
"name": "Group-1"
},{
"_id": {
"$oid": "636f2bc32fe088dd1654e3c0"
},
"id": 2,
"name": "Group-2"
}]
i have 3 collection student,project,group
notes:
One project have multiple groups.
One student have multiple projects but for one project he have only one group.
i expecting output as following
{
studentdetail…,
projectDetails:[
project:{
projectName:“project-1”,
group:{groupName:“group-1”}
}
project:{
projectName:“project-2”,
group:{groupName:“group-2”}
}
]
}