From 0907b5e04226f1e7845bbb8664e4ee159c445d3b Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 27 Jan 2021 13:56:26 +0800 Subject: [PATCH] fix bug elemMatch --- shared/db/Guild.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/db/Guild.ts b/shared/db/Guild.ts index c2345f285..9b7be56ae 100644 --- a/shared/db/Guild.ts +++ b/shared/db/Guild.ts @@ -192,7 +192,7 @@ export default class Guild extends BaseModel { } public static async updateCe(roleId: string, inc: number ) { - const result = await GuildModel.findOneAndUpdate({ $elemMatch: {members: roleId}, status: GUILD_STATUS.RUNNING}, {$inc: {guildCe: inc}}, {new: true}).lean(); + const result = await GuildModel.findOneAndUpdate({ members: { $elemMatch: [roleId] }, status: GUILD_STATUS.RUNNING}, {$inc: {guildCe: inc}}, {new: true}).lean(); return result; }