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

Query from documentation doesn't return expected result #7750

Closed
marcusx2 opened this issue Nov 4, 2023 · 1 comment · Fixed by firebase/snippets-web#360
Closed

Query from documentation doesn't return expected result #7750

marcusx2 opened this issue Nov 4, 2023 · 1 comment · Fixed by firebase/snippets-web#360

Comments

@marcusx2
Copy link

marcusx2 commented Nov 4, 2023

Operating System

macOS

Browser Version

Safari 16.5.2

Firebase SDK Version

10.5.0

Firebase SDK Product:

Firestore

Describe your project's tooling

index.html with source tag. Just javascript.

Describe the problem

The following query does not work, no document is returned

const db = getFirestore();
const citiesRef = collection(db, "cities");
querySnapshot = await getDocs(query(citiesRef, where("regions", "in", [ [ "west_coast", "east_coast" ] ])));
querySnapshot.forEach(doc => console.log(doc.id));

The code in question is documented here, you need to scroll up a little bit. Or search for the text "array-contains-any always filters by the array data type".

The documentation explicitly states "From the example data, only the DC document qualifies with its regions field of ["east_coast"]". However, it does not return the DC document, or any document for that matter.

You have to set up the data first.

Steps and code to reproduce issue

Already explained.

@marcusx2 marcusx2 added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Nov 4, 2023
@jbalidiong jbalidiong added documentation needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Nov 6, 2023
@MarkDuckworth MarkDuckworth self-assigned this Nov 6, 2023
@MarkDuckworth
Copy link
Contributor

@morganchen12, can you help me get this to the right person to modify these code snippets and documentation across all SDKs? We need to correct snippets and documentation for the in operator across all SDK languages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants