“Как получить статус соединения в мангуозе” Ответ

Как получить статус соединения в мангуозе

// after you connect
// uri ( or connection string ) is defined somewhere
const mongoose = require("mongoose")
mongoose.connect(uri, {useNewUrlParser: true, useUnifiedTopology: true})
    .then(console.log(`Data base connected ${mongoose.connection.readyState}`))
	.catch(error => console.log(error))
// readyState gives you the state of the connection
Code Sir

Как получить статус соединения в мангуозе

// after you connect
// uri ( or connection string ) is defined somewhere
const mongoose = require("mongoose")
mongoose.connect(uri, {useNewUrlParser: true, useUnifiedTopology: true})
    .then(console.log(`Data base connected ${mongoose.connection.readyState}`))
// readyState gives you the state of the connection
Code Sir

Ответы похожие на “Как получить статус соединения в мангуозе”

Вопросы похожие на “Как получить статус соединения в мангуозе”

Больше похожих ответов на “Как получить статус соединения в мангуозе” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования