云公司的FireStore GETALL()相当于扑(Cloud Firestore getAll(

2019-09-29 04:34发布

我有几个文件的ID,并希望所有的人都聚集后运行的功能。

现在我的代码如下所示:

    List<Future<DocumentSnapshot>> futures = [];
    currentVenuesIds.forEach((currentVenueId) {
      Future<DocumentSnapshot> venueFuture = Firestore.instance
          .collection('venues')
          .document(currentVenueId)
          .get();
      futures.add(venueFuture);
    });
    futures.getAll(...)   //????????? This does not exist

在云文档的FireStore有一种叫做方法getAll() https://cloud.google.com/nodejs/docs/reference/firestore/0.13.x/Firestore#getAll

有没有这样的事情对于Flutter SDK? 如果不是,什么是最好的方式get()从服务器上的多个文档以并行的方式,知道他们的所有的promise/future s的解决?

Answer 1:

只有服务器的SDK提供GETALL。 目前没有类似的移动SDK。 由于颤振SDK仅仅是围绕着Android和iOS SDK的包装,并没有那些提供GETALL,所以扑不还提供它。 现在,你只需要执行多个获得,这是不是像听起来那么坏(所有的请求都在流水线的单一连接)。

有大量的飞镖资源如何等待多个期货 。 这个问题是不是唯一的公司的FireStore。



文章来源: Cloud Firestore getAll() equivalent in Flutter