Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
mongoose error `users.insertOne()` buffering timed out after 10000ms

I keep getting this MongoDB error, this is my connection to mongodb. I am trying to make a register and login application

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();
});

this is the signup application

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)
        }
    }
})
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!