question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advanced Express Implementation of Social Authentication III - Deprecation for "findAndModify"

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SaintPetercommented, Sep 16, 2020

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.

0reactions
RandellDawsoncommented, Sep 23, 2020

@surajat17 We already have a PR for this issue that is probably going to be merged very soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Node and Express - Implementation of Social ...
(node:210) DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.
Read more >
Implementation of Social Authentication III - YouTube
... we learn an implementation of social authentication part III. This is one part of many making up the Advanced Node and Express...
Read more >
16 - Implementation of Social Authentication III - freeCodeCamp
The final thing we need to add is some database functionality and use the profile information obtained from GitHub to create a user...
Read more >
Implementation of Social Authentication I - YouTube
Implementation of Social Authentication I - Advanced Node and Express - Quality Assurance Cert · Key moments. View all · Key moments ·...
Read more >
Glossary — MongoDB Manual
See Authentication. authorization: Provisioning of access to databases and ... The application layer that uses a database for data persistence and storage.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found