jest-mongodb icon indicating copy to clipboard operation
jest-mongodb copied to clipboard

Need to update the documentation to reflect current 'mongodb' library

Open robertoshimizu opened this issue 2 years ago • 2 comments

The command

connection = await MongoClient.connect(global.__MONGO_URI__, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    });

has been deprecated. The useNewUrlParserand useUnifiedTopology were removed from the MongoClientOptions as per the explanation given by MongoDb https://www.mongodb.com/community/forums/t/argument-of-type-usenewurlparser-boolean-useunifiedtopology-boolean-is-not-assignable-to-parameter-of-type/169033/3

Therefore, it is recommended to update this library's documentation to avoid other users to struggle. Cheers RS

robertoshimizu avatar Mar 12 '23 12:03 robertoshimizu

Strongly agree. I've lost a decent amount of time trying to find a workaround! An update to the library's documentation should be included in jest-mongodb

NickVanzo avatar May 04 '23 07:05 NickVanzo

The README also refers to MongoClient.close() which no longer exists, due to which I don't know how to do a teardown.

jorisw avatar May 13 '23 13:05 jorisw