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

Fix read model queries when selecting deeply-nested arrays (local provider) #1553

Merged
merged 12 commits into from
Sep 30, 2024

Conversation

MarcAstr0
Copy link
Collaborator

@MarcAstr0 MarcAstr0 commented Sep 27, 2024

Description

This PR is related to #1552. It fixes the same issue but for the local provider. It changes the approach to selecting fields when querying read models in the local provider. Instead of passing projections to NeDB, the full object will be retrieved, and the fields indicated in the selection will be filtered in.

Changes

  • Modifies read-model-registry.ts to change how read models are queries.
  • Test added to read-model-registry.test.ts for querying a complex read model.

Checks

  • Project Builds
  • Project passes tests and checks
  • Updated documentation accordingly

@MarcAstr0 MarcAstr0 added the bug Something isn't working label Sep 27, 2024
Copy link

what-the-diff bot commented Sep 27, 2024

PR Summary

  • Change Log File Addition
    A new JSON file that logs changes has been added. This file, titled fix_nested_arrays_2024-09-27-19-40.json, details a patch that addresses handling of deeply-nested arrays in Read Model queries - complex database requests.

  • Updated Software Dependencies
    We've updated the versions of several software packages under the name @boostercloud in a file named pnpm-lock.yaml. These versions have changed from ^2.18.1 to ^2.18.2, promising better functionality and security.

  • Read Model Registry Refactoring
    Several important changes have been made to the Read Model Registry. We've removed local functionality that handled array fields, making the system simpler and more efficient. New code has been introduced - the filterFields method - that helps in filtering the returned search results based on specific criteria.

  • Testing Enhancements
    A new test case has been added to the read-model-registry.test.ts file, designed to ensure that only projected (expected) fields are returned for complex Read Models. This is done to ensure that our updated query method is functioning as intended.

@MarcAstr0
Copy link
Collaborator Author

/integration sha=c4a9e04

Copy link
Contributor

⌛ Integration tests are running...

Check their status here 👈

Copy link
Contributor

✅ Integration tests have finished successfully!

@MarcAstr0 MarcAstr0 marked this pull request as ready for review September 30, 2024 11:31
Copy link
Collaborator

@davidverdu davidverdu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarcAstr0 MarcAstr0 merged commit 9852720 into boostercloud:main Sep 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants