1234567891011121314151617181920212223242526272829303132333435363738 |
- '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 matchteam = {
- match_id: { type: String },
- match_name: { type: String },
- team_id: { type: String },
- team_name: { type: String },
- logo: { type: Array },
- create_id: { type: String },
- create_user: { type: String },
- create_time: { type: String },
- members: { type: Array },
- match_num: { type: String },
- apply_time: { type: String },
- win: { type: String },
- shu: { type: String },
- integral: { type: String },
- rank: { type: String },
- status: { type: String, default: '0' },
- format: { type: Array },
- remark: { type: String },
- };
- const schema = new Schema(matchteam, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ match_id: 1 });
- schema.index({ team_id: 1 });
- schema.index({ create_id: 1 });
- schema.index({ status: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Matchteam', schema, 'matchteam');
- };
|