Skip to content
Advertisement

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(..)

Answer

The connect functions exits inside mongoose package.

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

Advertisement