Ticket: Timeout - I can only pass with deprecated options object

After moving through this course quickly and applying knowledge to a real world project I’m working on, this timeout ticket stopped me for several days. I have read through the documentation several times, but can’t get it to pass with wtimeout and poolSize options at the top level, even though that is how it is explained in the documentation linked from the ticket.

The only solution that I found was in an old post on this forum following this syntax: MongoClient or how to connect in a new and better way — MongoDB Node.JS Driver 1.4.9 documentation

Even though the test passes with the old syntax, I know I am missing something. I get a message that says server and db are deprecated and all of their options (including wtimeout and poolSize) are now supported at the top level. This is exactly what I’ve been trying.

I am moving on with the course now, but want to understand what I was doing wrong so I can apply it to real projects. Is the testing environment using the deprecated settings, so the wtimeout and poolSize are actually working properly at the top level, but it still fails the text? When I use the options at the top level of index.js, the website still functions properly. Is this something that will be fixed when the course is revamped or I am just not understanding the documentation and implementation properly.

I’m not asking for a solution, but if it is only a problem with the test, I will move on with confidence that I have mastered this section. Otherwise, I want to continue to understand.


Check the following answer from @Rafael_Green, I think it is the same issue.

That solves the problem and explains what the issue was. Thank you very much for pointing me in the right direction.

1 Like