"Person.remove is not a function" MongoDB and Mongoose - Create Many Records with model.create()

Tell us what’s happening:

An error shows up that says “Person.remove is not a function”. I compared my code to the solution and code is correct. The issue is that .remove is deprecated. How do I pass the test?

I tried replacing all “.remove” with “.deleteOne” in server.js but the same error is still showing up. Haven’t been able to proceed in the course. (ik it says do not edit server.js but remove is deprecated so I had no other choice, same error comes up before editing server.js so that’s not the issue)

###Your project link(s)

solution: http://localhost:3000

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0

Challenge Information:

MongoDB and Mongoose - Create Many Records with model.create()

Where is your code
Link

Do not update the boilerplate dependencies.

It doesn’t matter if the method is getting deprecated as long as you do not update the dependency to a version where it has actually been deprecated, i.e. removed.

The deprecation warning is just a warning. It is telling you that in future versions it will be removed. It doesn’t affect the tests and as long as you keep the version of Mongoose that does contain the method, i.e. the version in the starting boilerplate code, you should be able to pass the tests with correct code.

Without seeing your code, we can’t help beyond that.


As an aside, the tests in server.js are using the remove method, so you can’t just update your own code. You would have to update the tests as well to not use remove.