-
-
Notifications
You must be signed in to change notification settings - Fork 44.9k
MongoDB and Mongoose - Delete Many Documents with model.remove() #43310
Copy link
Copy link
Closed
Labels
first timers onlyOpen for anyone doing contributions for first time. You do not need permission to work on these.Open for anyone doing contributions for first time. You do not need permission to work on these.scope: curriculumLessons, Challenges, Projects and other Curricular Content in curriculum directory.Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Metadata
Metadata
Assignees
Labels
first timers onlyOpen for anyone doing contributions for first time. You do not need permission to work on these.Open for anyone doing contributions for first time. You do not need permission to work on these.scope: curriculumLessons, Challenges, Projects and other Curricular Content in curriculum directory.Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Affected page
The lesson at https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/delete-many-documents-with-model-remove doesn't work with mongoose 6+ because now it just returns the
deletedCount, which causes the code from server.js, lines 343 through 351, to fail.Mongoose 6.0.1

Mongoose 5.4.13:

This would fix it: