Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question