From 22b3dbc551e1520a0c5962f5eb76650fe3c930ae Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 21 Feb 2023 16:29:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(gvg):=20=E6=BF=80=E6=88=98?= =?UTF-8?q?=E6=9C=9F=E7=A6=BB=E5=BC=80=E5=9F=8E=E6=B1=A0=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E4=BA=BA=E6=95=B0=E4=B8=8Dupsert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/GVGCity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/db/GVGCity.ts b/shared/db/GVGCity.ts index 13e5c3806..4791a6be7 100644 --- a/shared/db/GVGCity.ts +++ b/shared/db/GVGCity.ts @@ -55,7 +55,7 @@ export default class GVGCity extends BaseModel { // 减少人数 public static async decreasePlayer(configId: number, groupKey: string, cityId: number, roleId: string) { - const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, 'players.roleId': roleId }, { $inc: { userCnt: -1 }, $pull: { players: { roleId } }}, { new: true, upsert: true }).lean(); + const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, 'players.roleId': roleId }, { $inc: { userCnt: -1 }, $pull: { players: { roleId } }}, { new: true }).lean(); return city; }