-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add _count paramater support in search command. #100
Conversation
b9b631d
to
a8fcede
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Just some small comments and one potential issue with the Library
endpoint when the database is populated with bundles from the may-2024-connectathon repository.
needs tests fix Most tests fixed Clean up mongo query and fix aggregation cleanup and add _count tests Update comment
Simplify db operation return structure
91f3e7d
to
1d51f7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment!
Co-authored-by: Elsa Perelli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Summary
Add support for
_count
parameter for search operations.Note: I've left the
loadBundles
bundle loader script piece in for now, but I think we should potentially remove that since other functionality has been added that takes its place. We may want to keep it for the moment ahead of the connectathon in case it's useful (maybe we pull it off into another branch? or maybe just make sure the commit isn't deleted?).New behavior
The '_count' parameter can be used to limit the number of resources pulled from a search (default 50), while
page
can be used to indicate what page of search results (default 1st page).Code changes
README.md
updatedbOperations.ts
- update tofindResourcesWithQuery
andfindResourceElementsWithQuery
to use pagination and appropriately aggregate results with an aggregation pipeline (necessary to get the count and results in the same request)requestSchemas.ts
- update to allow '_count' and 'page' parametersLibraryService.ts
andMeasureService.ts
- updates to create pagination linksbundleUtils.ts
-createPaginationLinks
functionqueryUtils.ts
- handle creating limit and skip values in mongo query for use in pagination_count
/page
tests and updated queryUtils test to match new functionalityShould probably be removed:
loadBundles
script andpackage.json
update to run itTesting guidance
npm run check
in service folder