string - 如何从firestore中的字符串数组中查找字符串
问题描述
我有一个文档列表,每个文档都有一个名为“fav”的字符串数组字段,它有超过 50k 封电子邮件,几乎有 1000 个文档,每个文档的“fav”数组的长度可变,包括 50k、20k、10等。我正在获取所有文件
Firestore.instance.collection("save").snapshots();
通过 StreamBuilder
StreamBuilder(
stream: Firestore.instance.collection("save").snapshots();,
builder: (context, snapshot) {
if (!snapshot.hasData)
return Text("Loading Data.............");
else {
listdata = snapshot.data.documents;
return _buildBody(snapshot.data.documents);
}
},
)
现在我如何从每个文档的“fav”字段中搜索我所需的电子邮件?我必须在本地找到数组中所需的 id 后执行操作。
解决方案
这个问题不是很清楚,但据我了解,这就是你要找的
Firestore.instance.collection('save')
.where('fav', arrayContains: 'abc@gmail.com').snapshots()
推荐阅读
- javascript - 发送第一个心跳后,Discord Api 不再发送事件
- netflix-zuul - zuul在调用errorFilter之前将完整的堆栈跟踪传递回客户端,是否有阻止这种行为的方法
- python - 如何为二进制分类任务(非图像)输入实现 TCNN?
- jinja2 - 如何在 Jinja2 中归档结果?
- python-3.x - 查询 DRF 中的多个外键关系
- c# - 使用 AutoMapper 如何忽略没有可访问 getter 的目标属性
- python - PostgreSQL 不可用:instance=None:None,timeout=30s
- terraform - 我正在运行命令“terraform init”但收到此错误,而在同一台机器的其他文件夹中,此命令工作正常
- node.js - CSS 选择器 - Puppeteer - Node.js - 如何获取元素类
- vba - 在 excel vba 中输出 UTF-8 文本文件