获取Firestore中的所有集合 [英] Fetching all collections in Firestore

查看:101
本文介绍了获取Firestore中的所有集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用Firestore,所以我想显示项目中的所有集合名称.

I am using Firestore in my project, so i want to show all collection names in my project.

是否可以从Firebase项目中获取所有集合名称.

Is it posible to get all collection names from Firebase project.

谢谢..

推荐答案

只有有限的公共API可以获取顶级集合的列表.移动客户端(Android,iOS,Web)没有API. Node.js管理员客户端在 listCollections() https://googleapis.dev/nodejs/firestore/latest/Firestore.html"rel =" noreferrer> Firestore 获取该列表.或者,如果您要查找嵌套在文档下的子集合,请使用 DocumentReference.listCollections( ).

There are limited public APIs to get a list of top-level collections. Mobile clients (Android, iOS, web) have no API. Node.js admin clients have listCollections() on Firestore to get that list. Or, if you're looking for subcollections nested under a document, use DocumentReference.listCollections().

如果要在任何平台上获取列表,则应将该列表自己保存在已知文档ID中的已知集合中.

If you want to get a list on any platform, you should maintain that list yourself in a known collection inside a known document id.

这篇关于获取Firestore中的所有集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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