Firebase:arrayUnion导致DocumentReference.update失败

Firebase:arrayUnion导致DocumentReference.update失败,firebase,google-cloud-firestore,Firebase,Google Cloud Firestore,我正在为Firebase中的一个文档构建一个工厂,该文档以后必须被另一个文档引用。该列表将这些条目存储在引用数组中 import firebase from 'firebase/firebase'; //... let listDoc = db.collection('lists').doc(listId) db.collection('entries').add({ ... }) .then(entry => { listDoc.update({ entrie

我正在为Firebase中的一个文档构建一个工厂,该文档以后必须被另一个文档引用。该列表将这些条目存储在引用数组中

import firebase from 'firebase/firebase';

//...

let listDoc = db.collection('lists').doc(listId)
db.collection('entries').add({ ... })
  .then(entry => {
    listDoc.update({
      entries: firebase.firestore.FieldValue.arrayUnion(entry)
    })
  });
由于以下原因,此操作失败:
FirebaseError:使用无效数据调用函数DocumentReference.update()。不支持的字段值:自定义bI对象(在字段条目中找到)

我认为它可能因为某种原因被引用捕获,但即使我将
entry.id
传递给
arrayUnion
方法,它也会产生相同的错误。我已经检查了arrayUnion的文档,这一切似乎与预期的一样——我在这里遗漏了什么


Firebase JS SDK版本
7.14.2

这似乎可以通过将导入从
Firebase/Firebase
更改为
Firebase/app
来解决-该类型在这两种情况下均有效,但只有
firebase/app
返回正确的数据结构。

这似乎可以通过将导入从
firebase/firebase
更改为
firebase/app
来解决-该类型在这两种情况下都有效,但只有
firebase/app
返回正确的数据结构