Advanced Express Implementation of Social Authentication III - Deprecation for "findAndModify"
See original GitHub issueDescribe your problem and how to reproduce it: I am using the latest boilerplate for the “Implementation of Social Authentication III” challenge on a server I control. When I copy and paste the code for the GitHub database record creation and run it, I get a deprecation warning:
(node:22140) DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.
According to the MongoDB manual page, the replacement function, findOneAndUpdate
has been in place since Mongo 3.2. The boilerplate projects call out at least v3.6.
Deprecation notice: https://mongoosejs.com/docs/deprecations.html#findandmodify
The sample code in the challenge should be updated to use findOneAndUpdate
. The signature appears to be identical and worked for my code.
Add a Link to the page with the problem: https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/implementation-of-social-authentication-iii
Tell us about your browser and operating system:
- Browser Name: node.js / Chrome
- Browser Version: N/A
- Operating System: Ubuntu 18.04 LTS
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Haha, ok, I just figured that the signature was different, since my code failed, and I was coming here to update. Missed it by 4 minutes.
@surajat17 We already have a PR for this issue that is probably going to be merged very soon.