Argument of type ‘{ useNewUrlParser: boolean; useUnifiedTopology: boolean}’ is not assignable to parameter of type’

Hi @D_Guillaumant, welcome to the community.
As per the Connection Pool Options documentation:

In driver 3.5, we introduced some new connection pool-related options – maxPoolSize and minPoolSize – which were only respected when useUnifiedTopology was set to true . These options had legacy equivalents named poolSize and minSize , respectively, which could be used both with and without useUnifiedTopology set to true .

In driver 4.0, the legacy options have been removed, and only maxPoolSize and minPoolSize are supported. We have added options validation which should help you identify any usages of the old names.

Therefore you don’t need to pass these options:

And you can continue by connecting using the following syntax:

MongoClient.connect(process.env.MONGODB_URI)

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

3 Likes