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

Advertisement

Answer

The connect functions exits inside mongoose package.

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

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement