Skip to content

Add comma-separated and regex pattern support for set filtering#432

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/filter-sets-using-commas-or-regex
Draft

Add comma-separated and regex pattern support for set filtering#432
Copilot wants to merge 7 commits intomainfrom
copilot/filter-sets-using-commas-or-regex

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Set name filtering currently only supports exact single set matches. Users need to filter across multiple sets or use patterns like "ACF Fall" (all years) or "ACF [FWR]" (Fall/Winter/Regionals).

Changes

API layer (routes/api/query.js)

  • Split setName parameter by commas, trim whitespace

Database layer (database/qbreader/get-query.js)

  • Treat all set name inputs as case-insensitive regex patterns
  • Single pattern: direct $regex match on set.name
  • Multiple patterns: $or array within $and for proper composition with existing filters

UI (client/db/index.jsx)

  • Updated placeholder: "Set Name (supports regex, commas)"

Examples

// Single partial match
setName: "ACF Fall" 
// → matches "2023 ACF Fall", "2024 ACF Fall", etc.

// Multiple sets
setName: "2023 ACF Fall, 2024 PACE NSC"
// → matches either set

// Regex pattern
setName: "ACF [FWR]"
// → matches ACF Fall, ACF Winter, ACF Regionals

MongoDB Query Structure

// Multiple patterns with existing filters
{
  difficulty: { $in: [5] },
  category: { $in: ['Science'] },
  $and: [
    { $or: [
      { 'set.name': { $regex: '2023 ACF Fall', $options: 'i' } },
      { 'set.name': { $regex: '2024 PACE NSC', $options: 'i' } }
    ]}
  ]
}

Scope

Only affects /api/query endpoint used by database search page. Other endpoints (packet retrieval, user stats) continue using exact matching.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • qbreader2.z35tynb.mongodb.net
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/website/website/node_modules/.bin/mocha (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Use commas or regex to filter for sets</issue_title>
<issue_description>A user could enter 2023 ACF Fall, 2024 PACE NSC to filter for both sets, ACF Fall to get all ACF sets, or ACF [FWR] to get ACF Fall/Winter/Regionals. Potential fix for #293, #394. This should work on anywhere where the user can input a set name</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 6 commits February 8, 2026 06:42
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com>
Copilot AI changed the title [WIP] Use commas or regex to filter for sets Add comma-separated and regex pattern support for set filtering Feb 8, 2026
Copilot AI requested a review from geoffrey-wu February 8, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use commas or regex to filter for sets

2 participants