const mongoose = require("mongoose"); const Schema = mongoose.Schema; const CampaignSchema = new Schema({ name: {type: String, required: true}, description: {type: String}, color: {type: String}, createdBy: { type: Schema.Types.ObjectId, ref: 'User', required: true }, date: { type: Date, default: Date.now}, settings: { type: Object } }); module.exports = mongoose.model('Campaign', CampaignSchema);