Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMR-10165: Extend sorting capabilities for CMR-STAC collection search #355

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

dmistry1
Copy link
Collaborator

@dmistry1 dmistry1 commented Oct 3, 2024

Add support for sorting collection results

This PR adds support for sorting collection results by startDate, endDate, id, and title.

Changes

  • Updated current implementation of sort to comply with STAC standards
  • Implemented sorting functionality in the collection search endpoint
  • Added validation for sort fields
  • Updated documentation to reflect new sorting capability

Examples

GET Request

http://localhost:3000/stac/LPCLOUD/collections?sortBy=-properties.startDate,id

POST Request

http://localhost:3000/stac/SEDAC/collections

{
    "sortby": [
        {
            "field": "properties.id",
            "direction": "desc"
        }
    ]
}

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (7482b0e) to head (7e9e691).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   87.88%   88.19%   +0.30%     
==========================================
  Files          23       24       +1     
  Lines        1123     1152      +29     
  Branches      241      250       +9     
==========================================
+ Hits          987     1016      +29     
  Misses        136      136              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmistry1 dmistry1 merged commit 0590a70 into master Oct 4, 2024
5 checks passed
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.

4 participants