Ticket - Timeouts (wtimeout is deprecated)

Hello everyone! Please can I get some help with this issue?

This is my object:

{
    useNewUrlParser: true,
    useUnifiedTopology: true,
    poolSize: 50,
    wtimeout: 2500,
  },

and this is the error:

have you updated the file “test/config/mongoEnvironment.js” with the new configuration?

Yes. That’s how it looks like:

change this:

{
    useNewUrlParser: true,
    useUnifiedTopology: true,
    poolSize: 50,
    wtimeout: 2500,
  }

to:

{
    useNewUrlParser: true,
    useUnifiedTopology: true,
    poolSize: 50,
    writeConcern: {wtimeout: 2500}
  }
1 Like

Hey @Rafael_Green, what’s up! Thank you so much once again, it’s working just fine!

1 Like

It still doesn’t work.

Hi @Manuel_Temido_Rocha,
In src/dao/moviesDAO.js in the function getConfiguration,
change this:

    const { poolSize, wtimeout } = movies.s.db.serverConfig.s.options
    let response = {
      poolSize,
      wtimeout,
      authInfo,
    }

to:

    const { poolSize, writeConcern } = movies.s.db.serverConfig.s.options
    let response = {
      poolSize,
      wtimeout: writeConcern.wtimeout,
      authInfo
    }
3 Likes

Thanks @Rafael_Green, it worked for me.

Had to apply both changes.
But it was supposed to be taught, I’ve no idea how it worked.

The change in connect function parameters appears to be due to new releases but this getConfiguration function is complicated

@Rizwan_Liaqat, you can see in the MongoClientOptions, that the writeConcern option is an object composed of these fields.
You can suggest a fix to this issue in the course git repository.
Thanks,
Rafael,

It was perfect. There was a post already regardinng the write concern but I missed the cofig function.
thank you very much.
I’'ll suggest the fix as you said. Thanks.

1 Like

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