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

Places queries need rework. #20

Open
namark opened this issue Sep 15, 2022 · 1 comment
Open

Places queries need rework. #20

namark opened this issue Sep 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@namark
Copy link

namark commented Sep 15, 2022

The find requests for places and user places endpoints are not properly implemented:

async find(params: Params): Promise<any> {


The filtering logic requires a cross referencing the domains collection, and this is done by first querying domains with maximum pagination limit (1000), then using that information in the places query filters.

The proper solution would be to use a $lookup aggregation, to join the two collections and then do filtering there. That will also take care of including the domain information in the place entries in the response, which is currently done in typescript.

In the long run we might need to avoid $lookup aggregation by restructuring the database to be more inline with recommended practices.

@namark
Copy link
Author

namark commented Oct 16, 2022

$lookup aggregation is now implemented for places endpoint, but not user-places since the artificial limit is less of a problem there, and restructuring the whole database might still be necessary for performance.

@namark namark added the enhancement New feature or request label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant