我想知道是否可以在列表中显示集合,为每个列表项添加一个侦听器,然后当用户单击列表项(集合名称)时,然后指向相应的文档,并且可以生成所有文档的列表。
例如:列表显示所有集合,如果用户点击了#34; Roscommon"然后列表将显示"森林公园,罗克菲尔德"并且当用户选择一个时它将再次显示细节。
答案 0 :(得分:0)
不,你无法做到这一点。在涉及Android时,您无法在文档中显示所有集合。只有在使用Java时才能实现这一点。
看看 List subcollections of a document ,你会看到:
Cloud Firestore服务器客户端库的
.modal-content { display: flex; flex-direction: column; } .modal-content .top-section { background-color: #2EC55C; flex-grow: 1; min-height: 0; display: flex; } .modal-content .top-section .content-section { flex-grow: 1; background-color: #6733FC; display: flex; flex-direction: column; } .modal-content .top-section .content-section .title-section { background-color: #21DE71; flex-basis: 10vh; } .modal-content .top-section .content-section .beer-section { background-color: #FA64FF; flex-grow: 1; display: flex; } .modal-content .top-section .content-section .beer-section .image-section { background-color: #90FF00; flex-basis: 50%; display: flex; align-items: center; justify-content: center; } .modal-content .top-section .content-section .beer-section .image-section .image-container { background-color: #FBA02B; height: 72vh; width: 55vh; } .modal-content .top-section .content-section .beer-section .text-section { background-color: #F63333; flex-basis: 50%; } .modal-content .top-section .panel-section { flex-basis: 18vw; background-color: #BFFD19; padding-top: 15px; padding-left: 15px; padding-right: 30px; min-height: 0px; display: flex; flex-direction: column; overflow: auto; } .modal-content .top-section .panel-section .thumbnail-holder { margin-bottom: 15px; background-color: #6036AD; width: 95%; height: 160px; flex-shrink: 0; } .modal-content .bottom-section { background-color: #4283FA; flex-basis: 10vh; } @media (max-width: 1100px) { .modal-content .top-section .panel-section { flex-basis: 25vw; } } @media (max-width: 450px) { .modal-content .top-section .panel-section { display: none; } }
方法列出了文档引用的所有子集合。使用移动/ Web客户端库无法检索集合列表。您应该只在可信服务器环境中查找集合名称作为管理任务的一部分。如果您发现在移动/ Web客户端库中需要此功能,请考虑重构数据,以便可以预测子集合名称。