Ticket: Timeouts - wtimeout without Write Concern?

In the provided solution, it does not mention write concern but use wtimeout:

MongoClient.connect(
  process.env.MFLIX_DB_URI,
  { wtimeout: 2500, poolSize: 50, useNewUrlParser: true },
)

Shouldn’t it be something like this:

MongoClient.connect(
  process.env.MFLIX_DB_URI,
  { w: "majority", wtimeout: 2500, poolSize: 50, useNewUrlParser: true },
)

Hi @Sudeep_Biswas,

Starting in MongoDB 5.0, the implicit default Write Concern is w: majority. So even if you don’t provide the w in the options, it will take it as the majority anyways.

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

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.