From 1571611de80d2480485039680fc3f747e8c43e4d Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 27 Mar 2023 14:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(mongo):=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=85=A2=E6=97=A5=E5=BF=97=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/Artifact.ts | 1 + shared/db/BattleRecord.ts | 1 + shared/db/ComBattleTeam.ts | 1 + shared/db/GroupMessage.ts | 2 +- shared/db/LadderMatchRec.ts | 2 ++ shared/db/User.ts | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shared/db/Artifact.ts b/shared/db/Artifact.ts index bf23188c5..c3f71c735 100644 --- a/shared/db/Artifact.ts +++ b/shared/db/Artifact.ts @@ -9,6 +9,7 @@ import { RoleModel } from './Role'; */ @modelOptions({ schemaOptions: { id: false } }) @index({ roleId: 1, seqId: 1, id: 1 }) +@index({ seqId: 1 }) @index({ roleId: 1, quality: 1 }) @index({ batchCode: 1 }) @index({ status: 1 }) diff --git a/shared/db/BattleRecord.ts b/shared/db/BattleRecord.ts index a9df27d45..664988b15 100644 --- a/shared/db/BattleRecord.ts +++ b/shared/db/BattleRecord.ts @@ -40,6 +40,7 @@ class Record { } @index({ roleId: 1, battleId: 1 }) +@index({ roleId: 1, warType: 1 }) @index({ battleCode: 1 }) export default class BattleRecord extends BaseModel { @prop({ required: true }) diff --git a/shared/db/ComBattleTeam.ts b/shared/db/ComBattleTeam.ts index ac99c08fb..a4f1ba072 100644 --- a/shared/db/ComBattleTeam.ts +++ b/shared/db/ComBattleTeam.ts @@ -152,6 +152,7 @@ export class BossHp { @index({ teamCode: 1 }) @index({ roleIds: 1 }) +@index({ capId: 1 }) @index({ status: 1, blueprtId: 1, pub: 1}) export default class ComBattleTeam extends BaseModel { diff --git a/shared/db/GroupMessage.ts b/shared/db/GroupMessage.ts index f7dec0292..2123eaa8b 100644 --- a/shared/db/GroupMessage.ts +++ b/shared/db/GroupMessage.ts @@ -6,7 +6,7 @@ import { index, getModelForClass, prop, DocumentType, modelOptions } from '@type **/ @modelOptions({ schemaOptions: { id: false } }) @index({ roomId: 1, seqId: 1 }) -@index({ msgId: 1 }) +@index({ msgCode: 1 }) export default class GroupMessage extends BaseModel { @prop({ required: true, default: '' }) diff --git a/shared/db/LadderMatchRec.ts b/shared/db/LadderMatchRec.ts index ef930887e..2e5e2fde0 100644 --- a/shared/db/LadderMatchRec.ts +++ b/shared/db/LadderMatchRec.ts @@ -5,6 +5,8 @@ import { LadderDefense, LadderOppPlayerInfo, LadderOppPlayerHeroInfo } from '../ import { genCode } from '../pubUtils/util'; @index({ battleCode: 1 }) +@index({ roleId1: 1 }) +@index({ roleId2: 1 }) export default class LadderMatchRec extends BaseModel { @prop({ required: true }) battleCode: string; // 唯一code diff --git a/shared/db/User.ts b/shared/db/User.ts index 94a441136..6c09c9c26 100644 --- a/shared/db/User.ts +++ b/shared/db/User.ts @@ -20,6 +20,7 @@ class PlatForm { */ @index({ tel: 1 }) @index({ uid: 1 }) +@index({ userCode: 1 }) @index({ channelId: 1 }) export default class User extends BaseModel {