我当前正在使用 whereIn 为了这个。但一次只能得到10个或更少的药水。 根据firestore文档,其中10个条目或更少
whereIn
有没有办法在一次往返中一次得到10份以上的文件?
return _db .collection('books') .where('docId', whereIn: ['id1', 'id2'...'id10']) .get() .then((value) => value.docs.map((e) => BookModel.fromFireStore(e)).toList());
不,10是硬限制,不能超过。您需要执行多个查询才能按ID获取10个以上的文档 documentation 州:
in 在逻辑字段上(=)与相等或相等子句组合。
in