shelfio / jest-mongodb

Jest preset for MongoDB in-memory server
MIT License
587 stars 83 forks source link

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

Open robertoshimizu opened 1 year ago

robertoshimizu commented 1 year ago

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

NickVanzo commented 1 year ago

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

jorisw commented 1 year ago

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