MongooseError: Operation `details.insertOne()` buffering timed out after 10000ms

Hi All,

I just started to learn mongoDB and node js.

I am facing a issue during learning the first time setup with nodejs and mongoDB.

onst err = new MongooseError(message);

MongooseError: Operation details.insertOne() buffering timed out after 10000ms

this is my app.js file data with that i am getting this error.

const { request, response } = require('express')
const express = require('express');
const hbs = require('hbs');
const app = express();
const mongoose = require("mongoose");

const routes = require('./routes/main');
const Detail = require('./models/Detail');

// /static/css/style.css
app.use('/static', express.static("public"))
// app.use(express.static("public"))

app.use('', routes)

// Template Engine HBS 
app.set('view engine', 'hbs')
// this is the path where our all HTML files are available
app.set('views', 'views')

// MogoDB Connections
mongoose.set("strictQuery", false);
mongoose.connect("mongodb://localhost/nodejslearning", () => {
    console.log("database connected") 
            brandName:"Learn NodeJS",

app.get('/', (request, response) => {
    response.send("Wow This is the data from our server")

app.listen(process.env.PORT | 1111, () => {
    console.log('our website server is running now')

after updating in place of localhost this problem is resolved for me.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.