'use strict'; const Schema = require('mongoose').Schema; const moment = require('moment'); const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin'); const { ObjectId } = require('mongoose').Types; // 展会图片表 const dock_imgtxt = { dock_id: { type: String }, // 展会id sender_id: { type: String }, // 发送人id sender_name: { type: String }, // 发送人姓名 content: { type: String }, // 信息内容 img_url: { type: Array }, // 图片 video_url: { type: Array }, // 视频地址 send_time: { type: String }, // 发送时间 remark: { type: String }, }; const schema = new Schema(dock_imgtxt, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ dock_id: 1 }); schema.index({ sender_id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('DockImgtxt', schema, 'dockImgtxt'); };