-
Notifications
You must be signed in to change notification settings - Fork 11
Add index on the product collections field #101
Copy link
Copy link
Closed
OpenCodeChicago/hacktoberfest-2025-backend
#45Closed
Copy link
Labels
apiAPI endpoints & integrationAPI endpoints & integrationbackendIssues related to backendIssues related to backendhacktoberfestSpecial issue for HacktoberfestSpecial issue for Hacktoberfesthacktoberfest-2025Special issue for Hacktoberfest 2025Special issue for Hacktoberfest 2025mongodbMongoDB & database managementMongoDB & database managementmongooseMongoDB ODM / schema & model work (queries, models, migrations)MongoDB ODM / schema & model work (queries, models, migrations)node.jsBackend JavaScript / runtime (Express, APIs, server work)Backend JavaScript / runtime (Express, APIs, server work)priority: mediumImportant but not urgentImportant but not urgent
Milestone
Metadata
Metadata
Assignees
Labels
apiAPI endpoints & integrationAPI endpoints & integrationbackendIssues related to backendIssues related to backendhacktoberfestSpecial issue for HacktoberfestSpecial issue for Hacktoberfesthacktoberfest-2025Special issue for Hacktoberfest 2025Special issue for Hacktoberfest 2025mongodbMongoDB & database managementMongoDB & database managementmongooseMongoDB ODM / schema & model work (queries, models, migrations)MongoDB ODM / schema & model work (queries, models, migrations)node.jsBackend JavaScript / runtime (Express, APIs, server work)Backend JavaScript / runtime (Express, APIs, server work)priority: mediumImportant but not urgentImportant but not urgent
Type
Projects
Status
Done
Priority: High
Difficulty: Intermediate
Type: Backend (Node.js + MongoDB + Mongoose)
Description
We need to add an index on the
collectionsfield in theProductschema.This will improve performance for queries like
/api/collections/:namesince contributors and users will often fetch products by collection.Implementation Details
Update Product Schema
Verify Index Creation
collections.Testing
/api/collections/:name.Acceptance Criteria
collectionsfield has an index in MongoDB./api/collections/:namework as expected.db.products.getIndexes()that index exists.