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

[MongoDB] scalar list filter hasEvery is broken #3132

Closed
Weakky opened this issue Aug 17, 2022 · 0 comments · Fixed by #3088
Closed

[MongoDB] scalar list filter hasEvery is broken #3132

Weakky opened this issue Aug 17, 2022 · 0 comments · Fixed by #3088
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: mongodb

Comments

@Weakky
Copy link
Member

Weakky commented Aug 17, 2022

Overview

Let’s call string_list the following value: ["a", "b"].

Now try the following filter: { NOT: { string_list: { hasEvery: ["a", "c"] } } }

  • Postgres will return true, because string_list: { hasEvery: ["c"] } returns false, and !false is true
  • On Mongo though, we’ve implemented that differently. NOT hasEvery means “x does not contain any element of y”. Since "a" is present on both lists, it will return false.

To be clear, the Postgres result is the correct result.

Expected Result

The filter above should return true and not false

@Weakky Weakky added bug/2-confirmed Bug has been reproduced and confirmed. tech/engines Issue for tech Engines. team/client Issue for team Client. topic: mongodb labels Aug 17, 2022
Weakky added a commit that referenced this issue Aug 17, 2022
Weakky added a commit that referenced this issue Aug 17, 2022
Weakky added a commit that referenced this issue Aug 18, 2022
Weakky added a commit that referenced this issue Aug 18, 2022
Weakky added a commit that referenced this issue Aug 18, 2022
@Weakky Weakky self-assigned this Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: mongodb
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant