如何修复 "Property 'getAll' does not exist on type 'typeof firestore'"

How to fix "Property 'getAll' does not exist on type 'typeof firestore'"

我正在使用 firestore.getAll() 的文档 ID 数组获取文档列表。问题是我无法调用 getAll(),因为它似乎不存在于 firestore 和 AngularFire 中,或者我可能做错了什么。 预先感谢您and/or方向的帮助!

firebase.firestore.getAll(
[].concat(this.arrayOfUIDs).map(uid => this.firestore.doc(this.ref + uid)) 

Firebase 导入为:

import * as firebase from 'firebase';

而 .getAll() 在 AngularFirestore 中也不存在

预期结果:Return 一个包含文档列表的对象,其 ID 存在于 arrayOfUIDs

结果: getAll() 出错"Property 'getAll' does not exist on type 'typeof firestore'"

firestore 文档:https://cloud.google.com/nodejs/docs/reference/firestore/1.3.x/Firestore#getAll

getAll()是node SDK提供的方法。仔细检查 link 到您提供的 API 文档。 getAll() 当前不适用于 Web 客户端,但将来可能会发生变化。如果您想通过 ID 获取多个文档,则必须 .