I want to create a in-memory database using mongodb-memory-server and mongoose. Can anyone show the correct way to do it.
From version 7 and above
// this no longer works
const mongo = new MongoMemoryServer();
const uri = await mongo.getUri(); // ERROR: instance not started
// it is now
const mongo = await MongoMemoryServer.create();
const uri = mongo.getUri();