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

231
Views
why putting mongoose model files on parent directory gives mongoose Timeout error?

In my project,I am trying to implement microservice with node.js and put every service in separate folder. at first I tried to use same mongoose model folder for every service and put model folder in parent directory of each service,and import them from parent directory

import User from '../models/userModel'
import Message from '../models/Message'

But when i run insert database operation, it gives me messages.insertOne() buffering timed out after 10000ms, and it gives similar error on other database operation .

But when i put mongoose model folder in current directory of every service and import them with

import User from './models/userModel';
import Message from './models/Message';

it gives me the the result as i expected . I wanted to keep the model folder on parent directory, so that i don't have to create model folder inside every service directory.

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!