mrmBot-Matrix/utils/database.js

20 lines
578 B
JavaScript
Raw Normal View History

2019-09-13 20:02:41 +00:00
// database stuff
const mongoose = require("mongoose");
mongoose.connect(process.env.MONGO, { poolSize: 10, bufferMaxEntries: 0, useNewUrlParser: true, useUnifiedTopology: true });
const guildSchema = new mongoose.Schema({
id: String,
tags: Map,
prefix: String,
warns: Map,
disabledChannels: [String]
2019-10-28 20:21:06 +00:00
});
const Guild = mongoose.model("Guild", guildSchema);
const globalSchema = new mongoose.Schema({
cmdCounts: Map
});
const Global = mongoose.model("Global", globalSchema);
exports.guilds = Guild;
exports.global = Global;
exports.connection = mongoose.connection;