0
0
0xc00000e92019-11-05 20:44:05
JavaScript
0xc00000e9, 2019-11-05 20:44:05

MongoTimeoutError: Server selection timed out after 30000 ms?

Hello everyone, why is mongoose not connecting to cloudbase? (Atlas)

const mongoose = require('mongoose');

mongoose.set('useFindAndModify', false)
mongoose.connect('mongodb+srv://<тут пользователь>:<тут пароль>@obsbot-5yx0r.mongodb.net/test?retryWrites=true&w=majority', {useCreateIndex: true, useNewUrlParser: true, useUnifiedTopology: true});

let Team = mongoose.model('Team', { name: String, clan: String, country: String, language: String, link: String, captain: String, manager: String, players: String, password: String });

let new_team = new Team({
  name: "test",
  clan_name: "test",
  country: "test",
  language: "test",
  link: "test",
  captain: "test",
  manager: "test",
  players: "test",
  password: "test"
});
new_team.save(function(err, new_team, affected) {
  console.log(arguments);
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question