question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firestore fetching data error

See original GitHub issue

Description Doing a Firestore request with the where clause array-contains or array-contains-any doesn’t work correctly.

Code Example

Here I’m using the firestore instance directly and it works:

try {
  const a = await firestore().collection('jobs').where('extraTags', 'array-contains-any', ['javascript']).get();
  console.log(a.docs.map((r) => r.data()));
} catch (e) {
  console.error(e);
}

Here I’m using the firebase-module:

try {
  await this.$fireStore.collection('jobs').where('extraTags', 'array-contains-any', ['javascript']).get();
} catch (e) {
  console.error(e);
}

which throws:

Function Query.where() called with invalid data. Unsupported field value: a custom Array object

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
JFGHTcommented, Apr 24, 2020

Finally could replicate the error in Codesandbox:

https://codesandbox.io/s/trusting-fog-j9z6d?file=/pages/index.vue

Opened issue in Nuxt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to fetch data from Firestore [duplicate] - Stack Overflow
Your query is fetching all documents in the collection {userId} . If you haven't created the document {userId}/{title} then you will not get ......
Read more >
Get data with Cloud Firestore - Firebase
There are three ways to retrieve data stored in Cloud Firestore. Any of these methods can be used with documents, collections of documents,...
Read more >
Querying and filtering data | Firestore - Google Cloud
Firestore provides powerful query functionality for specifying which documents you want to retrieve from a collection or collection group.
Read more >
Cloud Firestore | FlutterFire
Firestore stores data within "documents", which are contained within "collections". Documents can also contain nested collections.
Read more >
Cloud Firestore - React Native Firebase
The collection method returns a CollectionReference class, which provides properties and methods to query and fetch the data from Cloud Firestore.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found