'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_expert_view = { title: { type: String }, // 标题 origin: { type: String }, // 来源 content: { type: String }, // 内容 remark: { type: String }, }; const schema = new Schema(kjzl_expert_view, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ title: 1 }); schema.index({ origin: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Kjzl_expert_view', schema, 'kjzl_expert_view'); };