Skip to content

Fix filter null value does not work #93

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 1 commit into from
Jun 30, 2025
Merged

Fix filter null value does not work #93

merged 1 commit into from
Jun 30, 2025

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Jun 30, 2025

Problem

Filter by null values doesn't work. It returns all values.

collection.getAll({ filter: { foo: null } })

Analysis

The current code checks whether the filter value is of type object, which is the case for null, so the null comparison never occurs.

Solution

Add a specific case for null values.

## Problem

Filter by null values doesn't work. It returns all values.

```js
collection.getAll(({ filter: { foo: null } })
```

## Analysis

The current code checks whether the filter value is of type object, which is the case for null, so the null comparison never occurs.

## Solution

Add a specific case for null values.
@fzaninotto fzaninotto added the RFR Ready For Review label Jun 30, 2025
@fzaninotto fzaninotto added this to the 4.1.3 milestone Jun 30, 2025
@djhi djhi merged commit f01b6ed into master Jun 30, 2025
5 checks passed
@djhi djhi deleted the fix-null-filter branch June 30, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants