从Firebase Firestore数据库集合中提取大量(大约300个)文档 [英] Extracting a large number (about 300) documents from a firebase firestore db collection

查看:63
本文介绍了从Firebase Firestore数据库集合中提取大量(大约300个)文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Firestore获取数据.该代码在 FutureBuilder ListView 中运行良好.我尝试将所有条目打印到控制台.下面的代码工作正常,但仅打印前10个左右的条目.

I am trying to get data from firestore. The code is working fine in FutureBuilder ListView.I tried printing all the entries to console. The code below is working fine but only printing first 10 or so entries.

Future getP() async {
  var firestore = Firestore.instance;
  var q = await firestore.collection('place_list').getDocuments();
  List<Map<String, dynamic>> list = q.documents.map((DocumentSnapshot doc) {
    return doc.data;
  }).toList();
  print(list);
  return q.documents;
}

我想将所有300个条目打印在控制台中.有人可以帮我吗?

I want to get all 300 entries to be printed in console. Can anyone help me out in this?

推荐答案

尝试使用此 debugPrint 代替 print

debugPrint(list.toString(), wrapWidth: 1024);

或添加此方法和

void printWrapped(String text) {
  final pattern = new RegExp('.{1,800}'); // 800 is the size of each chunk
  pattern.allMatches(text).forEach((match) => print(match.group(0)));
}

致电

printWrapped(list.toString());

printWrapped(list.toString());

检查以获取更多信息.

这篇关于从Firebase Firestore数据库集合中提取大量(大约300个)文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆