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

205
Views
Property 'connect' does not exist on type 'typeof import

I have problem when I try to use mongodb.connect() func..

import mongodb from "mongodb"
import dotenv from "dotenv"
dotenv.config()
mongodb.connect()

Then error appears " Property 'connect' does not exist on type 'typeof import(..)

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

To create a connection to mongodb, you should first import the MongoClient, then you need to create a instance of the client, and only through the instance you will be able to create the connection.

See the example bellow taken from mongodb package documentation in npm

  import { MongoClient } from 'mongodb'


  const url = 'mongodb://localhost:27017';
  const client = new MongoClient(url);
  await client.connect();

Check this out for more details.

about 4 years ago · Juan Pablo Isaza Report

0

The connect functions exits inside mongoose package.

Look into this link for more info [https://www.npmjs.com/package/mongoose]

about 4 years ago · Juan Pablo Isaza Report
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!