Skip to content

Commit

Permalink
fix multiplayer record in profile bug
Browse files Browse the repository at this point in the history
  • Loading branch information
k2xl committed Jun 19, 2024
1 parent 69721ae commit 78450f1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions helpers/getUsersWithMultiplayerProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,25 @@ export async function getUsersWithMultiplayerProfile(
localField: '_id',
foreignField: 'userId',
as: 'multiplayerProfile',
// match gameId
pipeline: [
{
$match: {
gameId: gameId,
},
},
],
},
},
// unwind multiplayer profile
{
$unwind: {
path: '$multiplayerProfile',
preserveNullAndEmptyArrays: true,
}

},

{
$project: {
...USER_DEFAULT_PROJECTION,
Expand Down

0 comments on commit 78450f1

Please sign in to comment.