Closed NotKaskus closed 3 years ago
it is already possible.
install dbd.mongo, read docs and use
const bot = new Aoijs.bot({... database: mongo})
in constructor
like this:
const mongoose = require('mongoose')
const mongo = require('dbdjs.mongo').default
mongoose.connect('mongoULR here', {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
keepAlive: true
})
mongo.createModel('main')
const bot = new Aoijs.Bot({
token: token,
prefix: ['!'],
mobile: false,
fetchInvites: true,
sharding: false,
shardAmount: 0,
disabledFunctions: [],
database:mongo
})
@KASKUSTTV using this, $getuservar[] etc will use mongo db
@KASKUSTTV using this, $getuservar[] etc will use mongo db
Nah, I tried it like in v3 of dbd.db v4 and yeah I already transferred all my files to my mongoDB server, after that I tried all $seyVar, $getVar etc... And it just return [Object object] and it's very buggy
Nah, I tried it like in v3 of dbd.db v4 and yeah I already transferred all my files to my mongoDB server, after that I tried all $seyVar, $getVar etc... And it just return [Object object] and it's very buggy
is not. I use it since forever. the problem is not with the database, but with how you are transferring
@KASKUSTTV using this, $getuservar[] etc will use mongo db
Nah, I tried it like in v3 of dbd.db v4 and yeah I already transferred all my files to my mongoDB server, after that I tried all $seyVar, $getVar etc... And it just return [Object object] and it's very buggy
"dbd" or "aoi"?
I tried it first in dbd.js v3 before it became aoi.js and in release of v4 of aoi.js I tried it again and it has the same problem (returns [Object object]). I ask the creator of it when it was first released and he said, "I maybe broke some code I'll try to fix it". And I follow the same procedure as stated there in #tips
@KASKUSTTV using this, $getuservar[] etc will use mongo db
Nah, I tried it like in v3 of dbd.db v4 and yeah I already transferred all my files to my mongoDB server, after that I tried all $seyVar, $getVar etc... And it just return [Object object] and it's very buggy
have you tried quickmongo or quick.db?
@ap0sentada database: "mongo" If you don't put something that is text in a string, it will be read as a value and will give an error
@ap0sentada database: "mongo" If you don't put something that is text in a string, it will be read as a value and will give an error
Lmao wrong. mongo is already defined so if u use "mongo" then it will return database value as mongo not the value of mongo which we defined before. So absolutely wrong as i know
As it will be a string and we want the const mongo value not the string value as the string value is the value inside a string like for ur opinion "mongo" is a string whose value is mongo but we don't want the value as mongo. We want the value of the const mongo. So the correct form will be database: mongo
and not database: "mongo"
This is already possible.
Type
Description
Variables System will use mongoDB database, like this,
bot.mongoDatabase("mongoURI", "some password", other option in mongoDB);
. It will be a lot more easier for managing data + less storage = smoother server