@defany

Как исправить ошибку при запуске VK бота на Mongodb?

При запуске бота вылезает ошибка такого типа:

Бот был запущен
(node:10760) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10760) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
D:\Программирование\node_modules\mongoose\lib\helpers\promiseOrCallback.js:19
throw error;
^

MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/

Я новичок в JS и не знаю как решить данную проблему.

Строка подключения выглядит так:
mongoose.connect('mongodb+srv://DeFaNJI:<(На этом месте пароль)>@cluster0.dz5ax.mongodb.net/VkBot?retryWrites=true&...', { useUnifiedTopology: true } , function (err) {

if (err) throw err;

console.log('Successfully connected');

});

Сразу скажу, что интернет на ноутбуке работает и IP адрес присутствует в white листе.

p.s Исправил.
  • Вопрос задан
  • 119 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы