Sigo recibiendo este error de MongoDB, esta es mi conexión a mongodb. Estoy tratando de hacer una solicitud de registro e inicio de sesión.
const { MongoClient } = require('mongodb'); const uri = "mongodbconnection"; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); client.connect(error => { const collection = client.db("test").collection("devices"); // perform actions on the collection object client.close(); });esta es la aplicación de registro
router.post('/register', async (req, res) => { //hashing the password const hashedPwd = await bcrypt.hash(req.body.password, saltRounds); //using passport-local for authentication const newUser = new User({ email: req.body.email, password: hashedPwd }) try { await newUser.save() console.log("new user created") } catch (error) { if (error) { console.log(error) } } })