Skip to content

Implement the pipeline builder for section endpoints. #280

@mikehquan19

Description

@mikehquan19

Section aggregate endpoints (/section/courses & /section/professors) use 2 Mongo pipelines, sectionCoursePipeline & sectionProfessorPipeline for aggregating data.

They are functional, but are hardcoded in each endpoint. Since the 2 pipelines share lots of stage, it would be more managable for us to write a single function that returns the appropriate pipeline based on the types of endpoints.

Moreover, improve the pipeline to aggregate /section/courses & /section/:id/course so that it should return an array of courses for the former and only a single course for the latter (instead of an array of one course).

Metadata

Metadata

Labels

L2A task suitable for someone who is comfortable implementing features.good first issueGood for newcomersrefactorRefactoring or rewriting the codebase

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions