19 lines
376 B
JavaScript
19 lines
376 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const mongoose = require('mongoose');
|
||
|
const Schema = mongoose.Schema;
|
||
|
|
||
|
const CampaignSchema = new Schema({
|
||
|
title: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
},
|
||
|
}, {
|
||
|
collection: 'campaign',
|
||
|
timestamps: {createdAt: 'timestamp'},
|
||
|
});
|
||
|
// optional more indices
|
||
|
CampaignSchema.index({timestamp: 1});
|
||
|
|
||
|
module.exports = mongoose.model('Campaign', CampaignSchema);
|