Try 127.0.0.1 instead of localhost
Also read about Ipv6 vs Ipv4 support
os: win10;
node: 18.12.1
mongodb: “^4.11.0”
Program which worked with node.js 16 doesn’t work with node.js 18.
Even the simplest sample:
const { MongoClient } = require('mongodb');
// or as an es module:
// import { MongoClient } from 'mongodb'
// Connection URL
const url = 'mongodb://localhost:27017';
const client = new MongoClient(url);
// Database Name
const dbName = 'myProject';
async function main() {
// Use connect method to connect to the server
await client.connect();
con…
Nodejs 18 is not supporting to MongoDB 4.4.0.
Please let us know which version of MongoDB version will support. what are the changes required for upgrade NodeJS version 18