|
@@ -3,6 +3,8 @@ const Schema = require('mongoose').Schema;
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
// 比赛信息
|
|
// 比赛信息
|
|
const match = {
|
|
const match = {
|
|
|
|
+ belong_id: { type: String, zh: '属于id', ref: 'User', getProp: [ 'name' ] }, // 比赛系统中用户的数据id
|
|
|
|
+ type: { type: String, zh: '赛事类别' },
|
|
logo: { type: Array, required: true, zh: '比赛logo' }, // 比赛logo
|
|
logo: { type: Array, required: true, zh: '比赛logo' }, // 比赛logo
|
|
name: { type: String, required: true, zh: '比赛名称' }, // 比赛名称
|
|
name: { type: String, required: true, zh: '比赛名称' }, // 比赛名称
|
|
start_time: { type: String, required: true, zh: '比赛开始时间' }, // 比赛开始时间
|
|
start_time: { type: String, required: true, zh: '比赛开始时间' }, // 比赛开始时间
|
|
@@ -19,6 +21,8 @@ const match = {
|
|
const schema = new Schema(match, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(match, { toJSON: { getters: true, virtuals: true } });
|
|
schema.index({ id: 1 });
|
|
schema.index({ id: 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
|
+schema.index({ belong_id: 1 });
|
|
|
|
+schema.index({ type: 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ start_time: 1 });
|
|
schema.index({ start_time: 1 });
|
|
schema.index({ end_time: 1 });
|
|
schema.index({ end_time: 1 });
|