# Outdated lesson for mongoose remove

**URL:** <https://forum.freecodecamp.org/t/outdated-lesson-for-mongoose-remove/486785>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [November 27, 2021, 12:49am UTC](https://forum.freecodecamp.org/t/outdated-lesson-for-mongoose-remove/486785 "2021-11-27T00:49:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fivwss](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fivwss/32/234537_2.png) [@fivwss](https://forum.freecodecamp.org/u/fivwss)\
**Post date:** [November 27, 2021, 12:49am UTC](https://forum.freecodecamp.org/t/outdated-lesson-for-mongoose-remove/486785/1 "2021-11-27T00:49:09Z")

</div>

Tests for the lesson ‘Delete Many Documents with model.remove()’ are outdated for mongoose v6 (on the github repo).  
deleteMany() and remove() return { deletedCount : n } in v6  
Tests are looking for data.n and data.ok, also they try to JSONparse(data) that causes a 500 error.  
I had to modify the server.js to pass the tests.

---

<div class="post-metadata">

**Author:** ![Sky020](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sky020/32/128093_2.png) [@Sky020](https://forum.freecodecamp.org/u/Sky020)\
**Post date:** [November 27, 2021, 2:28pm UTC](https://forum.freecodecamp.org/t/outdated-lesson-for-mongoose-remove/486785/2 "2021-11-27T14:28:41Z")

</div>

Welcome there,

This is why you are asked to install a specific version of the packages: [https://www.freecodecamp.org/learn/back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose](https://www.freecodecamp.org/learn/back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose)

Hope this clarifies

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [May 29, 2022, 2:28am UTC](https://forum.freecodecamp.org/t/outdated-lesson-for-mongoose-remove/486785/3 "2022-05-29T02:28:59Z")

</div>

Closed on May 29, 2022, 2:28am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
