Closed Moumouls closed 2 years ago
downgrade to mongo 3.6.3 fix the issue, but it's just a temporary fix. I do not know which Parse Server code use DB listening events. @dplewis @mtrezza if you have an idea 🙂
Thanks for reporting!
Can you please fill out the versions in the template so we know in what environment (Node / MongoDB driver) you are experiencing this issue?
This deprecation warning comes from Node, not from the MongoDB driver?
@mtrezza it seems to come from the native mongo driver: https://stackoverflow.com/questions/66190532/deprecationwarning-listening-to-events-on-the-db-class-has-been-deprecated-and
All version >3.6.3 seems to raise this log.
Thanks for the details, this seems to explain the fix needed:
Db is no longer the place to listen to events, you should listen to your MongoClient instead like so:
const client = new MongoClient(…) client.on(‘Event name I want to listen too’, () => {…}) await client.connect()
The reason for this style is because by registering your listeners before connecting you can be sure that you’re able to capture every event that is triggered
A search in the Parse Server code base should reveal the places where listening to DB has to be changed.
I classified this as bug with severity S4 (small/trivial):
Wasn't this fixed with: #7626? Why is it open still?
@Moumouls can you confirm this was fixed? #7626 does not reference this issue, but it also says that there are no more deprecation warnings, so I want to make sure.
I did not pull and try with master branch but with the same changes I get no depreciation warnings in an example project.
I assume we can close this then, thanks for the heads up.
You're welcome. Thank you for the good work.
hi @mtrezza technically we are okay now about warnings :)
Nice, thanks @Moumouls
New Issue Checklist
Issue Description
Lot of warning from mongodb package after upgrade from https://github.com/parse-community/parse-server/pull/7322
Steps to reproduce
Install parse from master Run parse server
At each server start parse server log.
Actual Outcome
Too many logs from mongodb pkg
Expected Outcome
No logs
Failing Test Case / Pull Request
Environment
Server
Database
4.4.X
Client
Logs