trainVideo.js 798 B

1234567891011121314151617181920212223
  1. "use strict";
  2. const Schema = require("mongoose").Schema;
  3. const moment = require("moment");
  4. const metaPlugin = require("naf-framework-mongoose-free/lib/model/meta-plugin");
  5. const { ObjectId } = require("mongoose").Types;
  6. // 展会视频表表
  7. const train_video = {
  8. train_id: { type: String }, // 展会id
  9. title: { type: String }, // 标题
  10. brief: { type: String }, // 简介
  11. video_url: { type: Array }, // 视频地址
  12. remark: { type: String },
  13. };
  14. const schema = new Schema(train_video, { toJSON: { virtuals: true } });
  15. schema.index({ id: 1 });
  16. schema.index({ dock_id: 1 });
  17. schema.index({ title: 1 });
  18. schema.index({ "meta.createdAt": 1 });
  19. schema.plugin(metaPlugin);
  20. module.exports = (app) => {
  21. const { mongoose } = app;
  22. return mongoose.model("TrainVideo", schema, "trainVideo");
  23. };