Good day, I am a newbie, I have two telegram bots written in node.js and I am using mongoose library. the first telegram bot performs admin function: adding users to MongoDB database. this bot has its own schema. the second telegram bot is for users. Here users enter data that was passed to the administrative bot to authorise themselves and access the functions of the user bot. the user bot refers to the schema of the administrative bot. all this is on a VPS Ubuntu Server.
I have this problem that when I add a new user, in MongoDB Compass the database is not called “mydatabase” but just "test" with collections.
I tried connecting via “mongodb+srv://user:password@myclaster.xo3epri.mongodb.net/mydatabase”, but I encountered that data saving is not going to the cluster, but to the old URI.
what am I doing wrong?
two bots are connected as follows:
mongoose.connect(
"mongodb://user:password@209.103.78.61:27017/mydatabase",
{
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
}
);