Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The use of callback functions is deprecated in MongoDB V. 7.0 #22

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

usapokemon
Copy link

NOTICE: As of 3/25/2024, the following packages have been upgraded:

MongoDB -->  7.0.7, 
Node.js Driver --> 6.5.0, and 
node.js language version --> V.20.10.1 

To solve the compatibility issues and issues such as "the callback functions are deprecated", the sample code for the book "The Get Programming with Node.js" needs to be modified to become compatible with the following environment:

mongod --version
7.0.7
node --version
v20.10.1
npm list mongodb
|--- [email protected]
|--- [email protected]
  |-- [email protected]

The major changes is due to the deprecation of callback functions in MongoDB accessing API functions. In lessons_13 - lessons_14, the changes are needed to use async/await. There are also minor changes, such as connect options that are no longer supported, e.g., useNewURL, useUnifiedTopology, and useCreatrIndex. Adding {family:4} to support IPv4 addressing mode, e.g., localhoast:3000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant