When making a call to the backend using this http request:
this.StudentEnrollment.getRecordsById(list.value.split(/[\r\n]+/)).subscribe(values => {
this.studentObject = values;
});
The studentObject is structured as shown below:
{
records: [{name: james, school: USC, .....}, {name: Micheal, school: UCLA, ......},{name:
John, school: UCLA, ......}],
size: 3
}
I am interested in organizing the schools and adding a count before integrating it into the studentObject. This would result in an object similar to:
[{school: UCLA, count: 2}, {school: USC, count: 1}]