opt-cc/api/models/campaign.js

19 lines
373 B
JavaScript
Raw Normal View History

2017-08-12 16:28:18 +02:00
"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);