'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 dock_imgtxt = { dock_id: { type: ObjectId, required: true }, // 展会id content: { type: String }, // 信息内容 img_url: { type: Array }, // 图片 file_url: { type: Array }, // 视频地址 user_id: { type: ObjectId }, // 创建人 remark: { type: String }, }; const schema = new Schema(dock_imgtxt, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ dock_id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Dock_imgtxt', schema, 'dock_imgtxt'); };