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

in comparator: Bug Or Documentation Error? #7029

Open
tylim88 opened this issue Feb 12, 2023 · 6 comments
Open

in comparator: Bug Or Documentation Error? #7029

tylim88 opened this issue Feb 12, 2023 · 6 comments
Assignees

Comments

@tylim88
Copy link
Contributor

tylim88 commented Feb 12, 2023

according to https://firebase.google.com/docs/firestore/query-data/queries#array-contains-any

image

However, after some testing, this statement is not true, it returns empty result

After some experiments, I found out that below statement is also incorrect

image

it should be array that contains EXACTLY west coast AND east coast

another thing is the comparator not-in also works with array type like in in above example, you can do something like query(citiesRef, where('regions', 'not-in', [['west_coast', 'east_coast']])) but is not documented, I think you should add it, seriously

if this is documentation error, don't ask me to submit feedback on the documentation site because you people never change anything and I have no record of what I have submitted. If I leave an issue instead, at least I can look back what is wrong

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@milaGGL
Copy link
Contributor

milaGGL commented Feb 13, 2023

Hi @tylim88, thank you for reporting this issue.

I reproduced the issue and have created an internal ticket to track it. I will keep you updated on the progress.

Google internal users please see it here: b/269160257.

@tylim88
Copy link
Contributor Author

tylim88 commented Feb 13, 2023

thanks @milaGGL

// =================//

I would like to share my thoughts about this issue

I don't think this is a bug, I think the current behavior is reasonable

not only the current behavior is easier to reason with, it actually can do what the doc want it to do
image

this is how the correct clause look: where('regions', 'in', [['west_coast'], ['east_coast']]) and it works

plus where('regions', 'not-in', [['west_coast'], ['east_coast']]) returns results that exclude results of where('regions', 'in', [['west_coast'], ['east_coast']])

so I think they work fine and I like the way they work now, they are much easier to understand

I WANT to believe this is simply documentation error that exist for long time (you guys never fix your documentation despite feedbacks) and they always work like this all these times

anyway, you guys do your stuff, this is just my opinion

@digimbyte
Copy link

image

@tylim88
Copy link
Contributor Author

tylim88 commented Feb 14, 2023

I tested the same thing with old firebase sdk 9.6.0 and 9.0.0 (a year ago)

The behavior are the same, it seem like the documentation is wrong all these times

@milaGGL
Copy link
Contributor

milaGGL commented Feb 23, 2023

Hi @tylim88. There is an internal ticket sent to documentation team, and I will keep you posted on any further updates. Thank you again for looking into the documentations and raising this issue.

@DellaBitta DellaBitta added the bug label May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants