Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda