Skip to main content
← Back to list
01Issue
FeatureOpenSwamp ClubPublic
AssigneesNone

Relationships

#3926 Showcase countByStatus: $match live statuses before the $group

Opened by keeb · 10/25/2026

lib/infrastructure/mongo-showcase-repository.ts countByStatus (added in #1412) runs a $group on $status over the whole profile_showcases collection with no $match. It can walk the { status: 1, createdAt: 1 } index instead of touching documents, but it still scans every entry, withdrawn ones included.

Admin-only, and the collection grows at human speed (every row is an admin-reviewed submission), so this won't matter for a long time. If the admin page ever feels slow, put $match: { status: { $in: ["pending", "approved", "rejected"] } } ahead of the $group so the optimizer uses the index more tightly and skips withdrawn documents.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/25/2026, 6:31:00 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.