apostrophecms / apostrophecms/apostrophe
3.5: MongoDb driver deprecation warning
- Dominant language
- JavaScript
- Stars
- 4.6k
- Forks
- 650
- Avg merge
- 19h 21m
- Merged PRs (30d)
- 23
Description
## To Reproduce
Start the application. The warning `isConnected is deprecated and will be removed in the next major version` is printed out in the console output.
## Expected behavior
No deprecation warning.
## Describe the bug
From the [documentation of the currently used driver](https://mongodb.github.io/node-mongodb-native/3.6/reference/unified-topology/#mongoclient-connect-isconnected), isConnected method is deprecated and will be removed in the next major version.
If `--trace-warnings` is used when starting the app, it's seen the problem is caused by the direct apostrophe dependency `connect-mongo@3.2.0` module used by Apostrophe. The `isConnected` use is removed in v4 of the module.
The migration to v4 of the module seems painless according to their [migration guide](https://github.com/jdesboeufs/connect-mongo/blob/master/MIGRATION_V4.md)
## Details
**Version of Node.js:**
v12.21.0
**Apostrophe:**
apostrophe@3.5.0 (against `main` branch)
**MongoDB driver:**
mongodb@3.7.2 (as reported by `npm ls`)
Contributor guide
Research direction
Start by reproducing the warning with --trace-warnings and inspect the direct connect-mongo@3.2.0 dependency identified in the report. Review the linked connect-mongo v4 migration guide and verify that starting the application no longer emits the isConnected deprecation warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, nodejs
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100