I have problem when I try to use mongodb.connect() func..
JavaScript
x
5
1
import mongodb from "mongodb"
2
import dotenv from "dotenv"
3
dotenv.config()
4
mongodb.connect()
5
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]