"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 train_video = { train_id: { type: String }, // 展会id title: { type: String }, // 标题 brief: { type: String }, // 简介 video_url: { type: Array }, // 视频地址 remark: { type: String }, }; const schema = new Schema(train_video, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ dock_id: 1 }); schema.index({ title: 1 }); schema.index({ "meta.createdAt": 1 }); schema.plugin(metaPlugin); module.exports = (app) => { const { mongoose } = app; return mongoose.model("TrainVideo", schema, "trainVideo"); };