12345678910111213141516171819202122232425 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const moment = require('moment');
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { ObjectId } = require('mongoose').Types;
- // 科学辟谣表
- const kjzl_refute = {
- title: { type: String }, // 标题
- origin: { type: String }, // 来源
- web: { type: String }, // 网址
- cover: { type: Array }, // 封面
- video_file: { type: Array }, // 视频文件
- content: { type: String }, // 内容
- remark: { type: String },
- };
- const schema = new Schema(kjzl_refute, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ origin: 1 });
- schema.index({ web: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Kjzl_refute', schema, 'kjzl_refute');
- };
|