opt-cc/api/models/campaign.js

19 lines
376 B
JavaScript
Raw Normal View History

2018-03-12 09:26:44 +01:00
'use strict';
2017-08-12 16:28:18 +02:00
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const CampaignSchema = new Schema({
title: {
type: String,
2018-03-12 09:26:44 +01:00
required: true,
},
2017-08-12 16:28:18 +02:00
}, {
collection: 'campaign',
2018-03-12 09:26:44 +01:00
timestamps: {createdAt: 'timestamp'},
2017-08-12 16:28:18 +02:00
});
// optional more indices
CampaignSchema.index({timestamp: 1});
module.exports = mongoose.model('Campaign', CampaignSchema);