firebase-module: Firestore fetching data error

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Finally could replicate the error in Codesandbox:

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

Opened issue in Nuxt.