Firestore:请求收集ID的列表 [英] Firestore: request for a list of collection IDs

查看:73
本文介绍了Firestore:请求收集ID的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firestore文档说:

文档读取以外的查询

对于文档读取以外的查询(例如,要求收集ID的列表),将向您收费 阅读一份文件.如果获取完整的结果集 需要多个请求(例如,如果您正在使用 分页),则每个请求只向您收费一次.

我找不到有关如何执行此类查询的任何信息-仅获取ID.

有人知道吗?

解决方案

您可以使用REST API获取集合ID.该文档位于此处

您还可以返回带有documentRef.getCollections()的集合ID数组,详细说明此处

Firestore documentation says:

Queries other than document reads

For queries other than document reads, such as a request for a list of collection IDs, you are billed for one document read. If fetching the complete set of results requires more than one request (for example, if you are using pagination), you are billed once per request.

I can not find any information of how to perform such queries - to get only IDs.

Anyone knows how?

解决方案

You can get the collection IDs using the REST API. The documentation is here

You can also return an array of collection IDs with documentRef.getCollections() as detailed here

这篇关于Firestore:请求收集ID的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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