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

2714 filter by confirmation date #2736

Merged
merged 5 commits into from
Jun 22, 2022
Merged

Conversation

iamleeg
Copy link
Contributor

@iamleeg iamleeg commented Jun 22, 2022

Added the first filter terms (the only field in the schema at the moment is confirmation date, so the filter is for confirmation date). Some design notes:

  1. The controller parses the filter terms from the HTTP query and builds some technology-agnostic predicates.
  2. The mongo store interprets the predicates to build a mongo query. It does this by adding a to_mongo_query() method to each type of filter. You could imagine that if we added a SQL store, it could add its own to_sql_query() methods allowing it to build a WHERE clause.
  3. Keywords used to construct the filter, i.e. dateconfirmedbefore/dateconfirmedafter are the same as the existing data service.
  4. On a large-scale data service you would want an index on confirmation_date for these searches to be efficient. I'm not doing indexes yet because there will be a lot of flux until the Day Zero schema is defined (and other decisions, like whether we use the list:true flag or some other mechanism for pseudo-atomic updates, are made). Currently a good option looks like pymong-migrate which could be embedded into this service so that on launch it migrates any indexes/validators it needs: open for discussion though!

@iamleeg iamleeg merged commit f892805 into main Jun 22, 2022
@iamleeg iamleeg deleted the 2714_filter_by_confirmation_date branch June 22, 2022 13:21
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.

None yet

2 participants