Skip to content

[MongoDBEventStore] Fix bug in projections.inline.count to ignore any null projections #250

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

Merged
merged 2 commits into from
May 26, 2025

Conversation

alex-laycalvert
Copy link
Collaborator

@alex-laycalvert alex-laycalvert commented May 22, 2025

Description

  • Previously, the projections.inline.count helper attempted to exclude null projections by checking for { $exists: false }
  • This does not work for the MongoDB query where projections are explicitly set to null
  • The new behavior ignores any non-existent or null projections (uses { $ne: null } in the query)
  • Adjusted projection helper tests to account for new behavior

Copy link
Collaborator

@oskardudycz oskardudycz left a comment

Choose a reason for hiding this comment

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

Good catch @alex-laycalvert, and thank you for fixing it 👍

@oskardudycz oskardudycz added enhancement New feature or request projections labels May 26, 2025
@oskardudycz oskardudycz added this to the 0.38.1 milestone May 26, 2025
@oskardudycz oskardudycz merged commit d6a7054 into main May 26, 2025
6 checks passed
@oskardudycz oskardudycz deleted the fix/mongodb-eventstore-count-incorrect branch May 26, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants