Firestore fetching data error
See original GitHub issueDescription
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:
- Created 3 years ago
- Comments:17 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Finally could replicate the error in Codesandbox:
https://codesandbox.io/s/trusting-fog-j9z6d?file=/pages/index.vue
Opened issue in Nuxt.
Documented with https://github.com/nuxt-community/firebase-module/commit/41a92b664391ef36aef6ed682e43243699b18d62