dart - 检查字符串是否已存在于 cloudfirestore 字段中的字段中并颤动
问题描述
我在cloudfirestore中有一个名为IDS的集合,里面有一个名为IDs的文档,在这个文档中我有以ID1开头的字段几乎达到ID14000,用户在文本字段中输入他的id,我需要检查id是否存在在田野里谢谢。
解决方案
final CollectionReference dbIDS = Firestore.instance.collection('IDS');
QuerySnapshot _query = await dbIDS
.where('ID', isEqualTo: theUserInputID)
.getDocuments();
if (_query.documents.length > 0) {
// the ID exists
}
推荐阅读
- mysql - MySQL如何进行查询以从我的联结表中获取信息以及不在该联结中的数据
- jmeter - 从外部配置文件中指定值
- unity3d - Unity DOTS 对普通游戏有多大好处?
- r - 在 R 中为这两个直方图添加图例
- python - for 循环过早停止而未覆盖参考列表中的所有项目
- playframework - 使用分块传输编码从 scala Play 服务器流式传输案例类对象
- sql - 是否可以即时将文本列转换为 json,然后在 postgres 中对其进行查询?
- elasticsearch - ElasticSearch:仅在满足多个条件时提升
- android - 查看 Android Studio 调试器中的所有方法调用?
- go - 供应商目录创建重复的冲突目录