module.exports = {
db_usar: DB_USAR, //adicionar por volta da linha 49
src/class/session.js
//const db = mongoClient.db('whatsapp-api')
const db = mongoClient.db(config.db_usar)
src/class/instance.js
//this.collection = mongoClient.db('whatsapp-api').collection(this.key)
this.collection = mongoClient.db(config.db_usar).collection(this.key)
por volta da linha 74
Hello!
suggestion for mult databases .env MONGODB_ENABLED=true MONGODB_URL=mongodb://127.0.0.1:27017/WHATS_API01 MONGODB_DB="whats-api01"
src/config/config.js const PORT = process.env.PORT || '3333' //porta atual const CLIENT_PLATFORM = process.env.CLIENT_PLATFORM || 'ConexaoWhatsapp' const DB_USAR = process.env.MONGODB_DB || 'whats-api07' //add
module.exports = { db_usar: DB_USAR, //adicionar por volta da linha 49
src/class/session.js //const db = mongoClient.db('whatsapp-api') const db = mongoClient.db(config.db_usar)
src/class/instance.js //this.collection = mongoClient.db('whatsapp-api').collection(this.key) this.collection = mongoClient.db(config.db_usar).collection(this.key) por volta da linha 74
this form it is possible define db to use