DEV Community

Discussion on: Set up MongoDB Atlas and connect with Node.js (avoid MongooseError: Operation x.findOne() buffering timed out after 10000ms)

Collapse
 
emmanuelthecoder profile image
Emmanuel Aiyenigba

I tried this, it didn't work. I keep getting the x.insertOne() error

Collapse
 
arunkc profile image
Arun K C

It might be because you are trying to use models before mongoose establishes a connection with the database. I too faced the same issue and was able to solve it by using async/await. You could check the details out in the following article. Hope this was helpful ✌️