For that problem, the standard solution is to import clientPromise because versions higher than 3.9/4.0 do not have "import {Mongoclient} " command.
Then also, if you want to use {MongoClient} then,
- stop the current running server
- Type ‘npm i mongodb@3.5.9’ in terminal
- Restart your server by ‘npm/yarn run dev’
Now it will work