Skip to content

Commit

Permalink
change join structure to include all users
Browse files Browse the repository at this point in the history
  • Loading branch information
k2xl committed Dec 17, 2023
1 parent 5bf1047 commit 79297eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion helpers/enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ export function getEnrichUserConfigPipelineStage(gameId: GameId, { localField, e
},
},
{
$unwind: '$config'
$unwind: {
path: '$config',
preserveNullAndEmptyArrays: true,
}
},

];
Expand Down
2 changes: 1 addition & 1 deletion pages/[subdomain]/users/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
ts: 1,
}
},
...getEnrichUserConfigPipelineStage(gameId),
...getEnrichUserConfigPipelineStage(gameId), // TODO: Figure out wtf we need to do this twice?
{ $sort: sortObj.reduce((acc, cur) => ({ ...acc, [cur[0]]: cur[1] }), {}) },
{ '$facet': {
metadata: [ { $count: 'totalRows' } ],
Expand Down

0 comments on commit 79297eb

Please sign in to comment.