I need to make a filter in an array, also need to have a counter to know how many records it has as the same id. I tried to do with the filter but I did not get it because I did not know what to compare it with. it is a list of students, it has only 3 different ones, and it repeats itself several times, because it is a list of medicines that are repeated for students.
var arr = [
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5359,
"co90Alun": 921,
"co00Apme": 281,
"dataApme": "2019-03-06",
"horaApme": "10:00",
"nomeApme": "Tylenol",
"dosaApme": "10 gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore.",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5360,
"co90Alun": 921,
"co00Apme": 281,
"dataApme": "2019-03-06",
"horaApme": "11:00",
"nomeApme": "Tylenol",
"dosaApme": "10 gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore.",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5361,
"co90Alun": 921,
"co00Apme": 281,
"dataApme": "2019-03-06",
"horaApme": "12:00",
"nomeApme": "Tylenol",
"dosaApme": "10 gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore.",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5362,
"co90Alun": 921,
"co00Apme": 281,
"dataApme": "2019-03-06",
"horaApme": "14:00",
"nomeApme": "Tylenol",
"dosaApme": "10 gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore.",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5363,
"co90Alun": 921,
"co00Apme": 281,
"dataApme": "2019-03-06",
"horaApme": "16:00",
"nomeApme": "Tylenol",
"dosaApme": "10 gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore.",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5340,
"co90Alun": 2601,
"co00Apme": 279,
"dataApme": "2019-03-06",
"horaApme": "16:00",
"nomeApme": "Aspirina",
"dosaApme": "10 Gotas",
"viadApme": "Oral",
"obsApme": "Aplicar mesmo que chore",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5357,
"co90Alun": 455,
"co00Apme": 280,
"dataApme": "2019-03-06",
"horaApme": "22:00",
"nomeApme": "Dipirona",
"dosaApme": "10ml",
"viadApme": "Oral",
"obsApme": "",
"situApme": "PEND",
"dhapApme": null
},
{
"gl90Tabl": null,
"linkRece": "",
"co01Apme": 5358,
"co90Alun": 455,
"co00Apme": 280,
"dataApme": "2019-03-06",
"horaApme": "23:00",
"nomeApme": "Dipirona",
"dosaApme": "10ml",
"viadApme": "Oral",
"obsApme": "",
"situApme": "PEND",
"dhapApme": null
}
]
console.log(arr)