Paiiss / bot-wa

Whatsapp bot using Bailey multi device
Apache License 2.0
43 stars 24 forks source link

MongoDB Error #15

Closed yourantithesis closed 1 year ago

yourantithesis commented 1 year ago
example : 1. mongodb+srv://yourantithesist:<password>@cluster0.d7sagsk.mongodb.net/?retryWrites=true&w=majority
                 2. mongodb+srv://yourantithesist:<password>@cluster0.d7sagsk.mongodb.net/wa-bot

result :

╭─── [ LOG ]
├ [  STATS  ] Error connecting mongodb, please make sure the url is correct!
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
    at NativeConnection.Connection.openUri (/root/bot-wa/node_modules/mongoose/lib/connection.js:694:11)
    at /root/bot-wa/node_modules/mongoose/lib/index.js:381:10
    at /root/bot-wa/node_modules/mongoose/lib/helpers/promiseOrCallback.js:41:5
    at new Promise (<anonymous>)
    at promiseOrCallback (/root/bot-wa/node_modules/mongoose/lib/helpers/promiseOrCallback.js:40:10)
    at Mongoose._promiseOrCallback (/root/bot-wa/node_modules/mongoose/lib/index.js:1234:10)
    at Mongoose.connect (/root/bot-wa/node_modules/mongoose/lib/index.js:380:20)
    at mongodb (/root/bot-wa/src/utils/database/mongodb.ts:6:10)
    at Object.<anonymous> (/root/bot-wa/src/main.ts:8:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module.m._compile (/root/bot-wa/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.require.extensions.<computed> [as .ts] (/root/bot-wa/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
Paiiss commented 1 year ago

Something is wrong with your mongodb link, enter your cluster password in yourantithesist:, for example mongodb+srv://yourantithesist:Allen@cluster0.d7sagsk.mongodb.net/wa-bot