Can't iterate over mongodb array
We are looking for a user in the database by '_id' "_id": "6381e7c6bf8892cf05c7c798", "username": "Teacher", "email": "[email protected]", "role": "teacher", "avatar": "fixtures/teacher.jpg", "token": "KNuSF7sscU3EJsMetUFKi", "authentication": true, "myCourses" and It is necessary to get a suitable object from the array using 'aggregate',…