This message shows up when I try to run this code. I'm following a tutorial online and am new to MERN stack.
import app from "./server.js";
import mongodb from "mongodb";
import dotenv from "dotenv";
dotenv.config(); /* configure dotenv */
const MongoClient =
mongodb.MongoClient; /* get access to MongoClient from MongoDB */
const port = process.env.PORT || 8000; //connect port
//Connect to MongoDB
MongoClient.connect(process.env.RESTREVIEWS_DB_URI, {
poolSize: 50,
wtimeout: 2500,
useNewUrlParser: true,
})
.catch((err) => {
console.error(err.stack);
process.exit(1);
})
.then(async (client) => {
//app.listen is used to start our web server, after connecting to the DB
app.listen(port, () => {
//we're listening at the port
console.log(`listening on port ${port}`);
});
});
How about remove poolSize: 50 and useNewUrlParser: true since the error told you they are not supported anymore ?