Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
My Mongoose Database is not connectin to my javascript code

So I Am Making A Discord Bot and i am stuck my database is not connecting here is the code:

const mongoose = require("mongoose");
const { Database } = require("../../config.json");



module.exports = {
    name: "ready",
    once: true,
    /**
    * @param {Client} client
    */ 
    execute(client) {
        console.log("O Bot X Leci Na Discorda 🪐!")
        client.user.setActivity("Twitch", {type: "STREAMING", url: "https://www.twitch.tv/olekiox"})

        if(!Database) return;
        mongoose.connect(Database, {
            useNewUrlParser: true,
            useUndenifiedTopology: true
        }).then(() => {
            console.log("O Bot X Jest Połączony Z Databasem 💻")
        }).catch((err) => {
            console.log(err)
        });
    }
}
        
    

idk what is wrong help pls

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!