const {Schema, model} = require('mongoose'); const CourseCollectionSchema = new Schema({ guildID: { type: String, required: true }, categoryID: { type: String, required: true }, roleChannelID: { type: String, required: true }, courses: [{ name: { type: String }, channelID: { type: String }, roleID: { type: String }, messageID: { type: String }, messageValue: { type: String } }], roleMessages: [{ messageID: { type: String } }], selectAllMessage: { type: String } }); CourseCollectionSchema.index({ guildID: 1, categoryID: 1 }, { unique: true }); module.exports = model('coursecollection', CourseCollectionSchema);