kjzl_expert_view.js 761 B

12345678910111213141516171819202122
  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_expert_view = {
  8. title: { type: String }, // 标题
  9. origin: { type: String }, // 来源
  10. content: { type: String }, // 内容
  11. remark: { type: String },
  12. };
  13. const schema = new Schema(kjzl_expert_view, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.index({ title: 1 });
  16. schema.index({ origin: 1 });
  17. schema.index({ 'meta.createdAt': 1 });
  18. schema.plugin(metaPlugin);
  19. module.exports = app => {
  20. const { mongoose } = app;
  21. return mongoose.model('Kjzl_expert_view', schema, 'kjzl_expert_view');
  22. };