kjzl_refute.js 857 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 科学辟谣表
  7. const kjzl_refute = {
  8. title: { type: String }, // 标题
  9. origin: { type: String }, // 来源
  10. web: { type: String }, // 网址
  11. cover: { type: Array }, // 封面
  12. video_file: { type: Array }, // 视频文件
  13. content: { type: String }, // 内容
  14. remark: { type: String },
  15. };
  16. const schema = new Schema(kjzl_refute, { toJSON: { virtuals: true } });
  17. schema.index({ id: 1 });
  18. schema.index({ origin: 1 });
  19. schema.index({ web: 1 });
  20. schema.index({ 'meta.createdAt': 1 });
  21. schema.plugin(metaPlugin);
  22. module.exports = app => {
  23. const { mongoose } = app;
  24. return mongoose.model('Kjzl_refute', schema, 'kjzl_refute');
  25. };