Вход

Просмотр полной версии : Ошибка при попытке подключения к Mongo...


Jimy
08.09.2022, 10:22
MongoServerSelectionError: Server at localhost:27017 reports maximum wire version 0, but this version of the Node.js Driver requires at least 6 (MongoDB 3.6)
Вот такое выдает в консоль... Что там про версии, какие надо ставить?
Спасибо! А вот так пытаюсь подключится:

....
const mongoose=require('mongoose')
const PORT = process.env.PORT || 3000
async function start(){
try{

await mongoose.connect('mongodb://127.0.0.1/test_db')
app.listen(PORT,()=>{
console.log('Сервер работает. Порт 3000')
})
}catch(e){
console.log(e)
}}

start()

Jimy
08.09.2022, 10:45
{
"name": "express",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.4",
"express-handlebars": "^3.0.2",
"mongodb": "^4.9.1",
"mongoose": "^6.5.5",
"uuid": "^3.3.2"
},
"devDependencies": {
"nodemon": "^1.18.11"
},
"description": ""
}

Jimy
08.09.2022, 11:16
Все, понял. Будет работать с мангустом v 4.3.1 :))