skip to Main Content

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',…

VIEW QUESTION

Mongodb – Get count of documents matching different conditions

I have collection: bookSchema as: [ { _id: ObjectId("637d05dc32428ed75ea08d09"), book_details: { book_name: "random123", book_auth: "Amber" } }, { _id: ObjectId("637d0673ce0f17f6c473dee2"), book_details: { book_name: "random321", book_auth: "Amber" } }, { _id: ObjectId("637d069a3d597c8458ebe4ec"), book_details: { book_name: "random676", book_auth: "Amber" } }, {…

VIEW QUESTION
Back To Top
Search