PROBLEM
As of Mongoose V5.5.3+, use of the .remove() function on documents was deprecated, and should no longer be used, it will throw an error for a non-existent function.
ERRORERROR: POST /v1/auth/logout 500 - 43.461 ms - message: refreshTokenDoc.remove is not a function
FIX
Anyone updating their mongoose with this project should use .deleteOne() instead. This project utilizes the deprecated .remove() in two locations within auth.service.js, and one location in the user.service.js
PROBLEM As of Mongoose V5.5.3+, use of the
.remove()
function on documents was deprecated, and should no longer be used, it will throw an error for a non-existent function.ERROR
ERROR: POST /v1/auth/logout 500 - 43.461 ms - message: refreshTokenDoc.remove is not a function
FIX Anyone updating their mongoose with this project should use
.deleteOne()
instead. This project utilizes the deprecated .remove() in two locations within auth.service.js, and one location in the user.service.jsauth.service.js LINES 27 - 33
auth.service.js LINES 40 - 52
user.service.js LINES 73 - 80