ServerSelectionError when connecting dockerized replica set

I just found this post(Mongoose unable to connect with Mongo Standalone replicaSet - #2 by kevinadi) suggesting some options to try out.

let opt = {poolSize:1, useNewUrlParser: true, useUnifiedTopology: true}
let conn = await MongoClient.connect(
    'mongodb://username:password@127.0.0.1:27017/test?authSource=admin&replicaSet=rs0',
    opt)

However, this makes error “saying option poolSize is not supported” and neither can I find other properties in MongoClientOptions in mongodb.d.ts.

I thought this was because the post was using MongoDB 5.0 when I’m using 6.0, but couldn’t find any reference to those options above in 5.0 doc(https://www.mongodb.com/docs/v5.0/reference/connection-string/#connection-options).

Does anyone know what happened since last summer?